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.

eZ debug

Timing: Jan 30 2025 19:38:51
Script start
Timing: Jan 30 2025 19:38:51
Module start 'layout'
Timing: Jan 30 2025 19:38:51
Module start 'content'
Timing: Jan 30 2025 19:38:51
Module end 'content'
Timing: Jan 30 2025 19:38:51
Script end

Main resources:

Total runtime0.0239 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.2656151.2266
Module start 'layout' 0.00470.0036 739.4922220.7188
Module start 'content' 0.00830.0140 960.21091,001.9609
Module end 'content' 0.02240.0016 1,962.171937.9922
Script end 0.0239  2,000.1641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002610.9442140.0002
Check MTime0.00104.3221140.0001
Mysql Total
Database connection0.00072.843610.0007
Mysqli_queries0.00229.220730.0007
Looping result0.00000.050810.0000
Template Total0.00114.510.0011
Template load0.00083.465910.0008
Template processing0.00031.065310.0003
Override
Cache load0.00062.426410.0006
General
dbfile0.00145.767880.0002
String conversion0.00000.024940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs