Forums / Setup & design / Menu showing all folders and subfolders ?

Menu showing all folders and subfolders ?

Author Message

Lex 007

Thursday 10 February 2005 5:11:19 am

I would like to make a menu showing ALL folders and subfolders at the same time. For example :

Folder 1
-- SubFolder 1.1
-- SubFolder 1.2
------ SubFolder 1.2.1
------ SubFolder 1.2.2
Folder 2
-- SubFolder 2.1
-- SubFolder 2.2

I tried using the treemenu operator but it seems it can only display subfolders of one specific node.

Thanks in advance for your help.

Felix Laate

Thursday 10 February 2005 5:32:59 am

Hi!

I'm sure there are many better ways than this one, but anyways...

{* Set your top category here *}
{let top_cat=2 used_node=false()}

{* See if we have already a node id otherwise use the top category as current node *}
{section show=is_set($DesignKeys:used.node)}
{set used_node=$DesignKeys:used.node}
{section-else}
{set used_node=$top_cat}
{/section}

{* Get a proper node object *}
{let node_obj=fetch(content,node,hash(node_id,$used_node))}

<ul id="nav">

{* FIRST LEVEL *}
{section loop=fetch(content,list,hash(parent_node_id,$top_cat, 
										limit, 6, 
										class_filter_type, "include", 
										class_filter_array, array(1),
										sort_by,array(array(priority))))}
{* check if container *}
				
{switch match=$:item.object.content_class.is_container}	
{* container *}
{case match=1}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a>
			
{* fiks 1 start *}
{let c1=fetch(content,list,hash(parent_node_id,$:item.node_id))}	
{section show=$c1}	
<ul>				
{* SECOND LEVEL *}
{section loop=fetch(content,list,hash(parent_node_id,$:item.node_id, 
										class_filter_type, "include", 
										class_filter_array, array(1),
										sort_by,array(array(priority))))}
{* check if container *}
{switch match=$:item.object.content_class.is_container}
{case match=1}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a>
					
{* fiks 2 start *}
{let c2=fetch(content,list,hash(parent_node_id,$:item.node_id))}	
{section show=$c2}	
					
<ul>
{* THIRD LEVEL *}
{section loop=fetch(content,list,hash(parent_node_id,$:item.node_id, 
										class_filter_type, "include", 
										class_filter_array, array(1),
										sort_by,array(array(priority))))}
{* check if container *}
{switch match=$:item.object.content_class.is_container}
{case match=1}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a>
							
{* fiks 3 start *}
{let c3=fetch(content,list,hash(parent_node_id,$:item.node_id))}	
{section show=$c3}
							
<ul>
{* FOURTH LEVEL *}
{section loop=fetch(content,list,hash(parent_node_id,$:item.node_id, 
										class_filter_type, "include", 
										class_filter_array, array(1),
										sort_by,array(array(priority))))}
{* check if container *}
{switch match=$:item.object.content_class.is_container}
{case match=1}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a>
									
{* fiks 4 start *}
{let c4=fetch(content,list,hash(parent_node_id,$:item.node_id))}	
{section show=$c4}

<ul>
</ul>
									
{section-else}        
{/section}
{/let}
			
{* fiks slutt *}
									
</li>
{/case}
{case}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a></li>
{/case}
{/switch}
{/section}								
</ul>
							
{section-else}        
{/section}
{/let}
			
{* fiks slutt *}
							
</li>
{/case}
{case}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a></li>
{/case}
{/switch}
{/section}	
</ul>
					
{section-else}        
{/section}
{/let}
			
{* fiks slutt *}
					
</li>
{/case}			
{case}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a></li>
{/case}
{/switch}
{/section}								
</ul>
			
{section-else}        
{/section}
{/let}
			
{* fiks slutt *}
			
</li>
{/case}
{case}
{* not container *}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a></li>
{/case}
{/switch}
{/section}
</ul>

{/let}
{/let}
	
</div>

I used this together with the http://www.csscreator.com/menu/multimenu.php to create (horizontal) dynamic menus. Skip it and it can be made static.

Hope it helps!

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Lex 007

Thursday 10 February 2005 6:02:16 am

Thanks, that's a pretty nice script ... but it doesn't work for me !
Only the folders of level 0 are shown. Any idea ?

Felix Laate

Friday 11 February 2005 1:54:27 am

Hi again!

My example was based on this: http://ez.no/ez_publish/documentation/customization/tips_tricks/creating_tree_menus

Just make sure to get rid of the show-things that says that things should only show if you're at a specific node.

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Marek Zywert

Friday 12 May 2006 8:10:00 am

Hi Lex 007,
I'm looking for this same solution - I'd like to show all menu with subfolders on a site.
Have you found solution?

xsayo

eZ debug

Timing: Jan 18 2025 19:32:15
Script start
Timing: Jan 18 2025 19:32:15
Module start 'content'
Timing: Jan 18 2025 19:32:16
Module end 'content'
Timing: Jan 18 2025 19:32:16
Script end

Main resources:

Total runtime1.0072 sec
Peak memory usage4,096.0000 KB
Database Queries202

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 588.9609180.8281
Module start 'content' 0.00670.8781 769.7891619.3281
Module end 'content' 0.88480.1224 1,389.1172341.3672
Script end 1.0072  1,730.4844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.4207210.0002
Check MTime0.00150.1537210.0001
Mysql Total
Database connection0.00070.072910.0007
Mysqli_queries0.920991.42942020.0046
Looping result0.00200.19622000.0000
Template Total0.977997.120.4890
Template load0.00230.232520.0012
Template processing0.975696.855620.4878
Template load and register function0.00010.009410.0001
states
state_id_array0.00150.147310.0015
state_identifier_array0.00100.097820.0005
Override
Cache load0.00200.2019380.0001
Sytem overhead
Fetch class attribute can translate value0.00120.115140.0003
Fetch class attribute name0.00110.109370.0002
XML
Image XML parsing0.00140.136940.0003
class_abstraction
Instantiating content class attribute0.00000.002090.0000
General
dbfile0.00400.4002330.0001
String conversion0.00000.000630.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs