Section filter for displaying menu

Author Message

Jeremy A

Friday 25 July 2008 2:34:05 am

Hi,

Currently I have 2 sections : private (id=7) and public (id=8).
In the menu (flat_top.tpl) it displays both section in one block.
I would like to display only one section (i.e. the public one at the left and the private one at the right)

I have debug the template like this :

{$item|attribute( 'show','2')}

$item is a link of the menu.

Then I found <i>>section_id</i> = 7 or 8, depends on the section.

So I'd like to add a thing like

{if eq( $item.section_id, '8' ) }      // displays only public section 

But it does not work, it never goes inside the if.

How could I get the section_id ?

Thank you.

Jeremy A

Monday 28 July 2008 1:28:33 am

Please can somebody help me ?

Ivo Lukac

Monday 28 July 2008 2:00:35 am

Hi Jeremy,

Section is attribute of object, so try:

{if eq($item.object.section_id,7)}
 

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Jeremy A

Monday 28 July 2008 3:03:05 am

Thank you =)

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 31 2025 04:33:35
Script start
Timing: Jan 31 2025 04:33:35
Module start 'layout'
Timing: Jan 31 2025 04:33:35
Module start 'content'
Timing: Jan 31 2025 04:33:35
Module end 'content'
Timing: Jan 31 2025 04:33:35
Script end

Main resources:

Total runtime0.0172 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 588.1328151.2109
Module start 'layout' 0.00680.0023 739.343836.6484
Module start 'content' 0.00910.0065 775.992290.2500
Module end 'content' 0.01560.0016 866.242233.9922
Script end 0.0172  900.2344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002715.6983140.0002
Check MTime0.00127.1483140.0001
Mysql Total
Database connection0.00158.970310.0015
Mysqli_queries0.002313.498930.0008
Looping result0.00000.074610.0000
Template Total0.00127.110.0012
Template load0.00105.532310.0010
Template processing0.00031.560710.0003
Override
Cache load0.00074.035210.0007
General
dbfile0.002615.185480.0003
String conversion0.00000.040140.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