Forums / Setup & design / Header image "override"
Sebastian Picklum
Monday 13 February 2006 11:14:40 pm
Hi!
I was wondering how to implement the following in the best possible way:Think of a pagelayout like ez.no where there is a header image (eZ systems logo in this case). Below is the navigation. Under the navigation, the content area starts.
What I want to do is to have a "header_image" attribute (Image) in some classes that replaces the standard header image if the attribute contains an image.
My idea to solve this is to do a fetch in pagelayout.tpl that gets the data $node_id (This produces overhead, I think). And then check $item.data_map.header_image.content.is_valid to see whether to display the standard-picture or the header_image picture. To gain a little speed, I was thinking of putting a {cache-block} around the code that displays the header_image picture.
Am I on the right track or is there a smarter way to do that?
Regards,
Sebastian
[email protected]
Thomas Nunninger
Monday 13 February 2006 11:56:50 pm
Hi,
perhaps you can include a "empedded_image.tpl" in pagelayout.tpl. Depending on the class identifier you can use the override system to include different templates. I think this should work even at this level.
Have a nice day
Thomas
Tuesday 14 February 2006 12:16:47 am
Thanks for your answer.
As far as I know, template inclusion would slow down eZ Publish. Or has this problem been solved already?
In my case, virtually every class using the standard pagelayout.tpl should be able to override the header image, so the template inclusion wouldn't be a benefit for me.
Maybe I should try the other way around and integrate the navigation into the content view templates. That way, there is no need to do a seperate fetch in pagelayout.tpl.