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.