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.