Insert a menu in a template that isn't pagelayout.tpl

Author Message

Salvatore Guarino

Thursday 01 September 2005 1:36:12 am

I need to add a menu in a custom template (i.e. my_product.tpl). I tried with this code:

<ul>
{def $mainMenu=treemenu( $module_result.path, $module_result.node_id, array('folder','folder_product','tire_chain'), 1, 6)}
{foreach $mainMenu as $menu}
    <li class="level_{$menu.level}">	
    {if $menu.is_selected}
        <div class="selected">
        <a href={$menu.url_alias|ezurl}>{$menu.text}</a>
        </div>
    {else}
        <a href={$menu.url_alias|ezurl}>{$menu.text}</a>
    {/if}
 
    </li>
{/foreach}
    </ul>

This doesn't work because I'm not in pagelayout.tpl and template variable 'module_result' here is unknown. What do I have to do to insert a menu in a template that isn't pagelayout.tpl?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.