Excluding a node from the left hand menu

Author Message

Andrew Wigglesworth

Sunday 05 December 2004 10:51:41 am

I've searched through the documentation and these forums for an answer to this, but so far have not found a solution that works.

I've used the section-exclude parameter, but this isn't working. The contents of the flat_left.tpl are below

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

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

{let docs=treemenu( $module_result.path,
$module_result.node_id,
ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),
0, 5 )
depth=1}
<ul>
{section var=menu loop=$:docs last-value}
{section-exclude match=eq($node_id, 332)}
{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>
*****************

Above I have used {section-exclude match=eq($node_id, 332)} , I've also tried
{section-exclude match=$:item.node_id|eq(332)} to no avail.

Anybody got any pointers?

(and, yes, the node number is correct)

Martin Ulrich

Sunday 05 December 2004 11:16:20 am

I'd like to know it too! (In meantime I solve that by putting the nodes which should not shown as subnodes under a class, which is not included. )

{let docs=treemenu( $module_result.path,
                    $module_result.node_id,
                    array( 1,31,32,33,35 ),
                    2, 2 )
                    depth=1}

but I am a kind of newbi, :-)

_______________________

http://artenic.de ARTENIC - Publishing mit allen Mitteln!

Mark Marsiglio

Sunday 05 December 2004 8:50:40 pm

This one is not pretty either, but it works.

I used an "offset" to skip the first item in the list. My nodes are sorted in priority order, so I just make sure the item I want to skip (in my case it is just a non-public storage folder) is the first one in my sorted list.

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

steve walker

Monday 06 December 2004 1:08:47 am

The excluding node code should work fine. Some working code I have in a treemenu from an old site is:

{* SECOND LEVEL *}
        {section show=$node_obj.path_array|contains($:item.node_id) loop=fetch(content,list,hash(parent_node_id,$:item.node_id, class_filter_type, "include", class_filter_array, array(1), sort_by, array(array(priority))))}
                {section-exclude match=$:item.node_id|eq(235)}				
				{section-exclude match=$:item.node_id|eq(214)}
				<li id="secondlevel"><img src={"design/news/images/maintemplate/secondlevel-arrow.gif"|ezroot} ALT="">&nbsp;<a href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a></li>

Checking Andrews code, try something on the lines of:

section-exclude match=$menu.node_id|eq(332)}

and any other variants you can think of.

Steve.

http://www.oneworldmarket.co.uk

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