Forums / Setup & design / How to show a specific include, depending on current section?
Maarten Holland
Friday 13 February 2004 3:50:41 am
Hello,
I've divided my site into several sections. Depending on which section is being viewed, I want to include a specific page for that section.
I think I can do it with {section show=} but can't figure out wich variable to use for the section. Can anyone tell me that or should I use 'case match' for this purpose?
Thank you in advance,
Maarten
Tore Skobba
Friday 13 February 2004 4:05:26 am
Hi
You could check on the $node being viewed with {$node.object.section_id}, i.e. {section show=$node.object.section_id|eq(1)} Load section 1 page{/section]
Note: the eq syntax might be wrong. Alternatively if you are not in the node template then use {$module_result.section_id} to get the current section.
Tips {$node|attribute(show)} lists all available attributes for $node, where $node can be any variable.
Tore
Wednesday 18 February 2004 12:14:40 am
Unfortunately I can't get it to work. If I'm not mistaken, I can't use 'node' when caching is disabled. Is that correct? I've disabled all my caches and try to use the following code:
{section show=$module_result.section_id}|eq(4)} {include uri="design/support/override/templates/page_4.tpl"} {/section}
4 Is the number of my section. Can anyone please tell me what I'm doing wrong?
Thank you very much for any help!