By mustikka on
I have module which i want to run on every page. How can i do that? And for later use: how to run module on specific pages?
I have module which i want to run on every page. How can i do that? And for later use: how to run module on specific pages?
Comments
You could use hook_init
You could use hook_init http://api.drupal.org/api/drupal/modules!system!system.api.php/function/...
An easier way would probally to create a block, and just load that block through drupal admin, there you can config on which pages to load.
http://drupal.stackexchange.com/questions/5582/easy-way-to-create-blocks...
Thanks! It works. Now i have
Thanks! It works.
Now i have another problem. What form i should return my function data from hook_init() ? Because:
doesn't work.
Called function returns modal window.
Do you want to add content to
Do you want to add content to all the pages, or javascript or do you just want to call a function of yours?
if you want to add content to all pages, you are better off using hook_page_alter or hook_page_build I think.
I want to add piece of
I want to add piece of JavaScript, if conditions match. So I used hook_page_alter to add a piece of JavaScript to the page, if necessary.
Thanks for your help!
Your welcome,if the problem
Your welcome,
if the problem is solved you could change the subject title and add [solved] to the front.