Forums / Setup & design / Left menu and sections

Left menu and sections

Author Message

Catherine Mollet @work

Tuesday 22 September 2009 8:20:24 am

Hello,
I think it's an obvious question, but if someone have the answer, it would help. I have a left menu on some pages (override of eZWebin flat_left.tpl), and I would like this menu to start at different levels according to sections. For exemple, I set it as

{def $left_menu_depth = $pagedata.current_menu|eq('LeftOnly')|choose( 2, 0 )}

to start at level 2, but let say for SectionId[]=10, I would like the menu to start at level 1. How can I do it ?
Thank you in advance.

Sander van den Akker

Friday 25 September 2009 9:53:32 am

This can be accomplished in multiple ways...

A quick way of doing this is by sending a parameter to the included template in pagelayout.tpl, like this:

{include uri='menu/flat_left.tpl' section=$module_result.section_id}

And in the flat_left.tpl:

{switch $section}
  {case '10'}
    {def $left_menu_depth = 2}
  {/case}
  ...etc
{/switch}

eZ Publish certified developer
http://auth.ez.no/certification/verify/392313