Share » Forums » Setup & design » adding tree functionality to 3.4...

adding tree functionality to 3.4 subleft menu template

adding tree functionality to 3.4 subleft menu template

Thursday 17 June 2004 6:57:13 am - 5 replies

Author Message

Mark Marsiglio

Thursday 17 June 2004 10:47:59 am

I think I have done what you are trying to do, but I am not sure. I have top level objects listed across the top of my site (in tabs). When you click on one of the tabs, the pages within that section appear in a left hand nav list with the section name at the top. If this is what you are trying to do I can post some code...

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

steve walker

Thursday 17 June 2004 12:02:30 pm

Mark,

It may be... I have top nav on top, and left hand sub nav working fine - but the left hand subnavigation doesnt expand out to show the third level navigation, and this is the bit I want to add.

If you have code that does this that would be marvellous!

Steve.

http://www.oneworldmarket.co.uk

Mark Marsiglio

Thursday 17 June 2004 12:36:47 pm

Try this...I have the depth set to 4 (four levels deep) but that is adjustable. In fact, that might be the only thing that I changed. This file is called flat_left.tpl and is located in mydesign/override/templates/menu folder.

Good luck...
Mark

<div id="leftmenu">
<div id="leftmenu-design">

<h3 class="hide">This menu {"Left menu"|i18n("design/base")}</h3>

<div id="navparent">
       {section name=parent loop=$module_result.path max=1 offset=1 }
             {section show=$parent:item.url}
                  <a href={$parent:item.url_alias|ezurl}>{$parent:item.text|wash}</a>
               {section-else}
    	      {$parent:item.text|wash}
               {/section}
    
         {/section}
</div>

{let docs=treemenu( $module_result.path,
                    $module_result.node_id,
                    array( 'folder', 'infopage', 'article' ), 1, 5 )
                    depth=4}
        <ul>
        {section var=menu loop=$:docs last-value}
            {section show=and( $menu.last.level|eq( $menu.level ), $menu.number|gt( 1 ) )}
                </li>
            {section-else}
            {section show=and( $menu.last.level|gt( $menu.level ), $menu.number|gt( 1 ) )}
                </li>
                    {"</ul>
                </li>"|repeat(sub( $menu.last.level, $menu.level ))}
            {/section}
            {/section}

            {section show=and( $menu.last.level|lt( $menu.level ), $menu.number|gt( 1 ) )}
                <ul>
                    <li class="menu-level-{$menu.level}">
            {section-else}
                <li class="menu-level-{$menu.level}">
            {/section}

            <a {$menu.is_selected|choose( '', 'class="selected"' )} href={$menu.url_alias|ezurl}>{$menu.text|shorten( 25 )}</a>

            {set depth=$menu.level}
        {/section}
           </li>

        {section show=sub( $depth, 0 )|gt( 0 ) loop=sub( $depth, 0 )}
            </ul>
        </li>
        {/section}
        </ul>

{/let}

</div>
</div>

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

steve walker

Friday 18 June 2004 3:03:15 am

Mark,

Many thanks - this code works perfectly!

Regards, Steve.

http://www.oneworldmarket.co.uk

Søren Knudsen

Tuesday 08 February 2005 8:23:01 am

How should i do if i only want to have the selected menu-item class="selected" in the menu, and not the whole path down to this item?

Best regards,
Søren Knudsen

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu