Forums / Setup & design / Creating menus based on sections

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' ) ) )}

eZ debug

Timing: Jan 30 2025 21:38:28
Script start
Timing: Jan 30 2025 21:38:28
Module start 'content'
Timing: Jan 30 2025 21:38:28
Module end 'content'
Timing: Jan 30 2025 21:38:28
Script end

Main resources:

Total runtime0.4399 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0082 587.9531370.2891
Module start 'content' 0.00820.0139 958.24221,001.5469
Module end 'content' 0.02210.4177 1,959.78913,890.4922
Script end 0.4399  5,850.2813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00461.0477200.0002
Check MTime0.00140.3113200.0001
Mysql Total
Database connection0.00080.178910.0008
Mysqli_queries0.332375.53301410.0024
Looping result0.00190.43741390.0000
Template Total0.417494.910.4174
Template load0.00090.208610.0009
Template processing0.416494.654910.4164
Override
Cache load0.00060.136410.0006
Sytem overhead
Fetch class attribute can translate value0.00170.382810.0017
XML
Image XML parsing0.00040.093010.0004
General
dbfile0.00651.4809200.0003
String conversion0.00000.001330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs