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.

eZ debug

Timing: Jan 19 2025 03:22:45
Script start
Timing: Jan 19 2025 03:22:45
Module start 'layout'
Timing: Jan 19 2025 03:22:45
Module start 'content'
Timing: Jan 19 2025 03:22:47
Module end 'content'
Timing: Jan 19 2025 03:22:47
Script end

Main resources:

Total runtime1.6595 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0088 590.4063152.6406
Module start 'layout' 0.00880.0035 743.046939.4766
Module start 'content' 0.01231.6456 782.5234572.2969
Module end 'content' 1.65790.0016 1,354.820312.1250
Script end 1.6595  1,366.9453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.2233160.0002
Check MTime0.00170.1051160.0001
Mysql Total
Database connection0.00170.103410.0017
Mysqli_queries1.601296.4847590.0271
Looping result0.00070.0397570.0000
Template Total1.594196.120.7970
Template load0.00250.151120.0013
Template processing1.591595.905320.7958
Template load and register function0.00020.012010.0002
states
state_id_array0.00830.500110.0083
state_identifier_array0.00390.234920.0019
Override
Cache load0.00210.1281170.0001
Sytem overhead
Fetch class attribute can translate value0.00060.036930.0002
Fetch class attribute name0.00250.152050.0005
XML
Image XML parsing0.00380.226630.0013
class_abstraction
Instantiating content class attribute0.00000.000950.0000
General
dbfile0.00360.2167230.0002
String conversion0.00000.000540.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs