Forums / Setup & design / Where is the {menu} function ?

Where is the {menu} function ?

Author Message

H-Works Agency

Sunday 27 August 2006 7:57:24 pm

I can't find anywhere in the doc the 'menu' function.

What are we supposed to do to use those left/top menus ? Do we have to use 'include' ?

Why is {menu name=DoubleTop} doesn't work ?

Thanx for those clarifications cause i never understood this issue since 2 years i am on EZP.

Martin Harispuru
LAMP - EZP 3.8.3

EZP is Great

Norman Leutner

Sunday 27 August 2006 11:24:55 pm

There are different ways og including a menu.
You may simply include the a prebuild ez menu or build and include your own one.

Including a menue works like any other template:

{include uri="design:left_menu.tpl"}

There are different ez menues which you can find under /design/base/templates/menu
Just take a look at them.

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Claudia Kosny

Monday 28 August 2006 12:11:50 am

Hello Martin

In addition to what Norman said also have a look at the menu.ini. Here you can better see what menus are available.

The 'DoubleTop' is just a group name which is useful to select the menu style when using the admin interface for EZ, it is not the name of the menu itself. The actual name of the menu is TopMenu, as you can see in the menu.ini. The menu.ini maps these menu names to the names of the templates that are used to display the menu. You can find the templates in the folder Norman mentioned.

This way you can also add your own menus, just create a template, name it accordingly, include it in the menu.ini and call it in your pagelayout.

Example:
I have two left menus that are included on a certain condition.
My menu.ini.append.php looks like this (just the relevant part)

[LeftTop]
TitleText=Left and top
MenuThumbnail=menu/left_top.jpg
TopMenu=flat_top
LeftMenu=flat_left
ProductLeftMenu=product_left

I included the menus in pagelayout.tpl like this:

{menu name=TopMenu}
.
.
.
{if <condition>}
{menu name=LeftMenu}
{else}
{menu name=ProductLeftMenu}
{/if}

The template for the ProductLeftMenu has the filename product_left.tpl and is located in the folder
\design\<name of site design>\templates\menu

Greetings from Luxembourg

Claudia

H-Works Agency

Monday 28 August 2006 1:17:45 am

Ok thanx a lot !!!

I finally understand the usage of the menu system.

Its still strange the reference documentation doesn't show the menu template function.

Martin Harispuru

EZP is Great