Closed (fixed)
Project:
Persistent Dismissable Messages
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Oct 2011 at 13:49 UTC
Updated:
10 Apr 2013 at 20:51 UTC
Jump to comment: Most recent file
Comments
Comment #1
soyarma commentedI hadn't directly considered this use-case. Persistent messages are stored in the db, and referenced by UID. Unfortunately in D7 anonymous users aren't easily separated from one another--my thought had been that you'd just set messages for anonymous users to not persist.
Are you thinking that you would like a message for an anonymous user to persist across multiple page loads, but be unique for that user?
Comment #2
kevinquillen commentedPretty much. Then you could have an entity / content type built around this, so there was a frontend to pdm_create_message.
An example of this would be here:
http://www.travelcoalition.org/
The 'Action Alert' is basically PDM, but the dismissing works for each anonymous user too (via cookie). But that requires UUID for anonymous users in their session to track in the cookie. If the user is logged in, it simply uses uid. Then again, I am using this in a way where a site admin can send out a message to all users and let them close it at will, not just when drupal_set_message is called for example.
But perhaps that is too much? I wouldn't mind closing User Alert in favor of this since it solves basically every other use case.
Comment #3
soyarma commentedI'll give this some thought. I do like the idea of creating alerts that would show for all users until dismissed--though that may start to chew up a lot of db space (because you need to store when they've been dismissed so they don't show again). However, once an alert made via the UI is removed from the site, we could remove all entries from the pdm table as well so that we don't clog things up with old data.
There is one caveat, because we'd use a cookie to determine if the user should still see the message or not, we would be serving non-cached pages to all users. If the message was non-dismissable then it wouldn't be an issue because all users could see the same message all the time and it would be OK, but if they were individually dismissable, and you put out a message to all users, then it would be the same as turning off all page caching on the whole site.
Comment #4
gcassie commentedhttp://drupal.org/project/session_api may help here.
Comment #5
xatoo commentedHere is a patch that will check whether the user is logged in.
If not, hidden messages will be registered in the browsers local storage and re-hidden upon page load.
Comment #6
soyarma commentedcommitted
Comment #7
soyarma commentedNow in 7.x-1.1-beta1