Exclude articles from menu

Author Message

Stuart DH

Wednesday 21 July 2004 12:15:25 pm

Hi guys,

Could anyone tell me where I can make the change to exclude articles from showing in the left menu - I only want to be able to see the folders and subfolders. I'm using 3.4.1 with the 'News' style.

Thanks in advance

Stuart

http://www.wildaboutbritain.co.uk

Paul Forsyth

Thursday 22 July 2004 12:51:40 am

If you are showing the menu with a section loop try:

{section-exclude match=eq($node_id, 23)}

paul

--
http://www.visionwt.com

Stuart DH

Thursday 22 July 2004 1:39:46 am

Hi Paul,

Thanks for your reply. I take it that this means I would have to id every article node that I want to exclude?

I'm using the standard sub-left.tpl


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

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

{section show=and( is_set( $module_result.path[1] ), is_set( $module_result.node_id ) )}
{let root_node=fetch( content, node, hash( node_id, 2 ) )
     submenu=fetch( content, list, hash( parent_node_id, $module_result.path[1].node_id,
                                         class_filter_type, include,
                                         class_filter_array, ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),
                                         sort_by, $root_node.sort_array ) )}
    <ul>
    {section var=menu loop=$submenu}
        <li class="menu-level-0"><a href={$menu.url_alias|ezurl}>{$menu.name|shorten( 25 )}</a></li>
    {/section}

    {section show=$submenu|count}
    <li class="menu-level-0"></li>
    {/section}
    </ul>

    <div class="breakall"></div>

{/let}
{/section}

</div>
</div>

http://www.wildaboutbritain.co.uk

Paul Forsyth

Thursday 22 July 2004 3:03:56 am

Yip, add in an exclude for each node id you want to prevent appearing.

Its not a great solution but it works ;)

There are better ways of dealing with this. First, design your content tree in a way to minimise what is shown, then you can restrict the search by class and section. If things are still being shown use the exclude method. You could link it to an ini file that has a list of nodes...

paul

--
http://www.visionwt.com

Stuart DH

Thursday 22 July 2004 3:38:18 am

Thanks for the info Paul,

I think I'll have a bash at option 2 - building a menu to only show certain sections & classes etc.

Cheers

Stuart

http://www.wildaboutbritain.co.uk

Stuart DH

Thursday 22 July 2004 6:08:21 am

Crikey! It was a whole lot easier than I thought it would be

Just replace the code in flat-left.tpl

ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),

with

array('folder'),

No more articles showing :)

http://www.wildaboutbritain.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 18 2025 19:03:31
Script start
Timing: Jan 18 2025 19:03:31
Module start 'layout'
Timing: Jan 18 2025 19:03:31
Module start 'content'
Timing: Jan 18 2025 19:03:32
Module end 'content'
Timing: Jan 18 2025 19:03:32
Script end

Main resources:

Total runtime0.9525 sec
Peak memory usage4,096.0000 KB
Database Queries66

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 587.9063152.6250
Module start 'layout' 0.00770.0110 740.531339.4453
Module start 'content' 0.01870.9322 779.9766534.2734
Module end 'content' 0.95090.0016 1,314.250016.1641
Script end 0.9525  1,330.4141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.4110160.0002
Check MTime0.00180.1892160.0001
Mysql Total
Database connection0.00110.111010.0011
Mysqli_queries0.871191.4497660.0132
Looping result0.00100.1014640.0000
Template Total0.878892.320.4394
Template load0.00240.247720.0012
Template processing0.876492.007520.4382
Template load and register function0.00020.025010.0002
states
state_id_array0.00120.127110.0012
state_identifier_array0.00220.228420.0011
Override
Cache load0.00210.2178370.0001
Sytem overhead
Fetch class attribute can translate value0.00070.072620.0003
Fetch class attribute name0.00140.152160.0002
XML
Image XML parsing0.00040.039820.0002
class_abstraction
Instantiating content class attribute0.00000.001360.0000
General
dbfile0.00810.8513100.0008
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 25
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs