Forums / Setup & design / Menu madness

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
-------------------------------------------

eZ debug

Timing: Jan 31 2025 01:23:05
Script start
Timing: Jan 31 2025 01:23:05
Module start 'content'
Timing: Jan 31 2025 01:23:05
Module end 'content'
Timing: Jan 31 2025 01:23:06
Script end

Main resources:

Total runtime0.2080 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.0090 587.8047370.3125
Module start 'content' 0.00900.0155 958.11721,005.5938
Module end 'content' 0.02450.1834 1,963.71093,895.3750
Script end 0.2079  5,859.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00532.5562200.0003
Check MTime0.00150.7180200.0001
Mysql Total
Database connection0.00120.560010.0012
Mysqli_queries0.103349.66931410.0007
Looping result0.00160.74601390.0000
Template Total0.183088.010.1830
Template load0.00090.433210.0009
Template processing0.182087.522710.1820
Override
Cache load0.00060.301910.0006
Sytem overhead
Fetch class attribute can translate value0.00221.042310.0022
XML
Image XML parsing0.00030.147610.0003
General
dbfile0.00864.1285200.0004
String conversion0.00000.003030.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