Creating menus based on sections

Author Message

Trond Åge Kvalø

Monday 02 February 2004 5:02:09 am

Sorry if this is question is too basic, but I've spent several hours searching the forums and docs now without success. So here goes:

I have a page with one top menu and one left menu.

In the left menu I'd like to have all folders that belongs to section 9.
The top menu should consist of all folders that does NOT belong to section 9.

Any ideas how I can achieve that?

Best regards
Trond Kvalo
Senior developer
Atlantia as
Norway

trondåge

Claus Jensen

Monday 02 February 2004 5:34:12 am

Hey there,
You could do this with fetches and {section show=eq($section_id, 9)} ...blablabla.. etc and {/section}
fetch could for instance be:
{section loop=fetch( content, list, hash( section_id, 9,
class_filter_type, include,
class_filter_array, array( 'folder' ),
sort_by, $node.sort_array }
{$:item.name}
{/section}
this may not be totally correct but something like that should work, better check the correct syntax for fetching with section_id's in the docs.

Cheers,
claÜs

Kevin Myles

Friday 23 July 2004 9:57:43 am

I was hoping to do the same and I found a different thread ultimately led to my success.
read the last post by Jan

http://www.ez.no/community/forum/developer/fetch_content_by_section_id

basically, it tells you to add an attribute_filter which of course, is the section,

However, I found that you had to replace the $node_section_id or whatever it was) with the section you wanted, so in my case, the end result code was:

      {let menuitems=fetch( 'content', 'list', hash( 'parent_node_id', 2,
                                                   'sort_by', $root_node.sort_array, attribute_filter, array( 'and', array( 'section', '=', 1 ) ),
class_filter_type, include,
                                                   class_filter_array, array( 'folder' ) ) )}

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 01:16:42
Script start
Timing: Jan 31 2025 01:16:42
Module start 'layout'
Timing: Jan 31 2025 01:16:42
Module start 'content'
Timing: Jan 31 2025 01:16:42
Module end 'content'
Timing: Jan 31 2025 01:16:42
Script end

Main resources:

Total runtime0.8701 sec
Peak memory usage8,192.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 588.1563151.2109
Module start 'layout' 0.00460.0042 739.3672220.6875
Module start 'content' 0.00870.8606 960.05474,338.7266
Module end 'content' 0.86930.0008 5,298.781312.1563
Script end 0.8701  5,310.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.4246160.0002
Check MTime0.00130.1528160.0001
Mysql Total
Database connection0.00060.071610.0006
Mysqli_queries0.793991.2367590.0135
Looping result0.00050.0588570.0000
Template Total0.817894.020.4089
Template load0.00320.362120.0016
Template processing0.814793.624020.4073
Template load and register function0.00180.203410.0018
states
state_id_array0.00110.122310.0011
state_identifier_array0.00380.441620.0019
Override
Cache load0.00240.2717330.0001
Sytem overhead
Fetch class attribute can translate value0.00160.189330.0005
Fetch class attribute name0.00160.179230.0005
XML
Image XML parsing0.00030.038230.0001
class_abstraction
Instantiating content class attribute0.00000.000930.0000
General
dbfile0.00070.0805100.0001
String conversion0.00000.000840.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
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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: 17
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs