Featured post
set a message in drupal -
i need 1 of 2 things in drupal
- have ability set info message specific user view next time login. message show in standard $messages variable. looked see if drupal_set_message() had capabilities didn't find it
- run function everytime page loaded info cause drupal_set_message sent
i prefer second option, if has suggestions.
i place code in hook_init(). of drupal has been loaded , available on every page load.
within that, query list of messages form database , funnel them drupal_set_message(). $messages variable stored in session, need call drupal_set_message() @ time want show message.
storing need present message different challenge, , depends on how determine message needs set. if based on elapsed time, can skip custom coding , go straight rules--defining triggers , actions based on user login date.
if more dynamic messaging scheme, need notify users of events have happened in absence, might use write code based around message module or it, allow record messages database, , query dated since user's last login. in fact, idea, bears further thought...
a more specific question in recommending more targeted solutions.
- Get link
- X
- Other Apps
Comments
Post a Comment