Forums / General / Setting random header images

Setting random header images

Author Message

Sergei Chusmah

Thursday 16 August 2007 3:57:56 am

Hi, i'm new to ez and I have a simple question...

I have a template which overrides the standard pagelayout.tpl.
The template has an image inserted in its header. I'd like the image to change randomly, so I need to read the image filename from an ini file randomly and pass the result to the template.
I'd like to know where should I put the code that calculates then passes the var to the template. The code is not related to any module in particular, it must be executed in every page, so I don't know which php file should it be put into...

Many thanks in advace!

Softriva .com

Sunday 26 August 2007 9:58:13 am

This might be helpful

http://ez.no/community/forum/setup_design/fetching_random_content_combined_with_cache

Sergei Chusmah

Tuesday 28 August 2007 12:34:26 am

Thanks for the info. My main problem is getting some content into the template, though...

As the content belongs to the header template, which is displayed all pages, I don't know exactly where to put the code that generates it.

I'll try adding a fetch function to one of my modules and call it using the template fetch function from the header template... i don't know if that is the right way...

Thanks anyway!