By prinds on
Hi,
I'm making a module that shows a warning to the user if he or she is using internet explorer 6 or worse using drupal_set_message().
I started adding drupal_set_message() to the mymodule_preprocess_page hook, but the warning didn't show until the next page (or page reload). What hook function should I use in order to set the message in time?
I tried using mymodule_theme() which actually works, but I'm not sure this is the best place to do this..
Btw. can anyone point me to a good resource showing an overview of the internal structure of drupal 6... (a flowchart or something like that)
regards
Ole
Comments
use the init hook
Found an answer myself. It seems a better option is to use the mymodule_init()
I followed this advice, but
I followed this advice, but had a problem where the messages were sometimes being displayed twice (i.e. for some reason hook_init() was being called twice on a single page). I fixed this simply by setting the "repeat" drupal_set_message() argument to false.
I'd love a module that did
I'd love a module that did this! I'm trying to hard code a solution into my template but it's very hackish, a module would be much better!
I would like to share it
I would like to share it with you (and everybody else)..
I tried to create a project page for it, but the maintainers suggested, that it should be a feature patch for the already existing project ie6 warning..
A good idea, but I'm afraid that means that I won't be able to upload it just now.. (I don't really know how to create patches, yet..)
However, the module i so basic and simple, that I can simply post the code here, and then you can use that for now.
ie6_warning_message.info
ie6_warning_message.module
Enjoy..