Left menu with only_translated parameter

Author Message

GDA AS

Tuesday 09 May 2006 3:27:49 am

The standard left menu uses the <b>treemenu</b> operator.

I need to make a menu that does not show nodes without a translation for the current language.

This is easy to achieve in other templates using the <b>only_translated</b> parameter in the fetch function. But treemenu does not apear to support this.

Can anyone point me in the right direction on how to make a left menu template using "normal" fetch functions (the ones that support only_translated)?

Kristof Coomans

Tuesday 09 May 2006 3:49:20 am

The treemenu operator was enhanced in eZ publish 3.8 ( http://pubsvn.ez.no/nextgen/stable/3.8/doc/features/3.8/enhanced_treemenu.txt ). You can use the language parameter.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Vjeran Vlahovic

Wednesday 07 June 2006 5:12:18 pm

Here's one quick 'n' dirty (maybe) solution for <3.8 versions...

In kernel/classes/ezcontentobjecttreenode.php, at line 1617 (3.7.6)

 

$onlyTranslated   = ( isset( $params['OnlyTranslated']      ) )                       ? $params['OnlyTranslated']     : false;
 

change this false to true. This will ensure that subTree function always returns only translated objects. Didn't test this much and don't know can this have some unwanted side effects.

http://www.netgen.hr/eng

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