Menu madness

Author Message

Pål Messenlien

Thursday 09 June 2005 3:32:33 am

Im building a new site here at work in eZ publish. And ive started strugling with menu's for the site. I want this to be as dynamic as possible, even so easy that the users can build them theirself. And i dont want to create a specific menu for each section of the page. Will try to explain a litle how i think this should be.
Iv'e started building the structure of the site like this:

-><b>Folder</b>
-->Article
-->Links
-->Article etc
---><b>Folder</b>
--->Article
--->Links
--->Article etc

This is where i want to build the menu from. List all the article names as a menu item, and the links as a menu item wich directs directly to the link and not the document with the link in it. Click on the second folder and you open up a new page with the content of the folder as menu items. The idea is to have a frontend publishing tool wich let the user create a new folder, article or link. And then the menu will build upon that.

Do anyone have code for such a menu, or can point me into the right direction of how todo this.

--------------------------------------------
Høgskolen i Lillehammer
Lillehammer University College
http://www.hil.no
--------------------------------------------
Messenlien IT
http://messenlien.com
-------------------------------------------

Felix Laate

Thursday 09 June 2005 6:15:27 am

Hi Pål!

You could use the treemenu operator. Here's an example of a menu with two levels.

<table width="126" cellpadding="0" cellspacing="0">
{let mainMenu=treemenu( $module_result.path, $module_result.node_id, array('folder','article'), 1, 3 )}
{section var=menu loop=$mainMenu}
{section show=$menu.item.is_selected}								
	<tr>
		<td></td>
	</tr>
	<tr><td class="leftmenu{$menu.item.level|inc}" onMouseOver="this.style.backgroundColor='#A4ABB3'" onMouseOut="this.style.backgroundColor='#BCBCc6'" onClick="window.location.href={$menu.url_alias|ezurl('single')}">{$menu.text|shorten( 25 )}</td>
	</tr>
{section-else}
{switch match=$menu.item.level}
{case match=1}
	<tr>
		<td></td>
	</tr>
	<tr>
		<td class="leftmenu{$menu.item.level|inc}" onMouseOver="this.style.backgroundColor='#A4ABB3'" onMouseOut="this.style.backgroundColor='#B4BFCC'" onClick="window.location.href={$menu.url_alias|ezurl('single')}">{$menu.text|shorten( 25 )}</td>
	</tr>
{/case}
{case}
	<tr>
		<td></td>
	</tr>
	<tr>
		<td class="leftmenu{$menu.item.level|inc}" onMouseOver="this.style.backgroundColor='#A4ABB3'" onMouseOut="this.style.backgroundColor='#BCBCc6'" onClick="window.location.href={$menu.url_alias|ezurl('single')}">{$menu.text|shorten( 25 )}</td>
	</tr>
{/case}
{/switch}								
{/section}
{/section}
{/let}
</table>

Hope it makes sense..

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Pål Messenlien

Friday 10 June 2005 6:18:13 am

Thanks, i found my way around it.

--------------------------------------------
Høgskolen i Lillehammer
Lillehammer University College
http://www.hil.no
--------------------------------------------
Messenlien IT
http://messenlien.com
-------------------------------------------

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 18 2025 19:29:36
Script start
Timing: Jan 18 2025 19:29:36
Module start 'layout'
Timing: Jan 18 2025 19:29:36
Module start 'content'
Timing: Jan 18 2025 19:29:37
Module end 'content'
Timing: Jan 18 2025 19:29:37
Script end

Main resources:

Total runtime0.6843 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 589.2344152.6094
Module start 'layout' 0.00740.0040 741.843839.4141
Module start 'content' 0.01140.6710 781.2578539.4766
Module end 'content' 0.68240.0019 1,320.734412.1953
Script end 0.6842  1,332.9297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4648160.0002
Check MTime0.00130.1937160.0001
Mysql Total
Database connection0.00080.117210.0008
Mysqli_queries0.634792.7488570.0111
Looping result0.00050.0761550.0000
Template Total0.654395.620.3272
Template load0.00210.309420.0011
Template processing0.652295.312220.3261
Template load and register function0.00010.017710.0001
states
state_id_array0.00120.170810.0012
state_identifier_array0.00090.138020.0005
Override
Cache load0.00170.2422240.0001
Sytem overhead
Fetch class attribute can translate value0.00060.094420.0003
Fetch class attribute name0.00090.137140.0002
XML
Image XML parsing0.00060.089920.0003
class_abstraction
Instantiating content class attribute0.00000.001340.0000
General
dbfile0.00090.1279160.0001
String conversion0.00000.002640.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
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/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: 14
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs