Left menu best practise

Author Message

Sander van den Akker

Wednesday 30 December 2009 7:42:31 am

I am facing a design question regarding the left menu in a new project. In the website interface, as well as some of my previous projects, menu includes are located inside the pagelayout template. Whether it is shown, and when, is configured in menu.ini.

Wouldn't it be more flexible on object level (and also cleaner) to include menu templates inside the appropriate full templates, instead of working with many ini settings and the persistent_variable? Or will this cause cache or performance problems?

eZ Publish certified developer
http://auth.ez.no/certification/verify/392313

Nicolas Pastorino

Tuesday 26 January 2010 3:26:53 am

Hi Sander,

Having the left menu in the view template means the menu will be view-cached, on a per-node basis. This means that whenever you want to change the content of your menu (adding a menu entry for example), you will need to clear all nodes' view cache...which is not recommended :) Another con is that regenerating a node's view cache will take longer for it needs to compute the left menu on top of its own content.

Now that the persistent_variable exists and works fine, information passing between view templates and the pagelayout is actually pretty easy. This can allow for a highly contextual menu. In terms of performance optimization, cache-blocks can be used around the menu, using the appropriate keys and options to have it expire when it is required.

As to the use of menu.ini, it is no dogma. It is indeed shipped with eZ Publish, but its usage is, as most of the other solutions shipped (eZ Flow, eZ Webin), simply an example onhow to best use the features. You may decide to not use it, alleviating some ini configuration.

Hope it helps. Interested in knowing how you actually solved the issue (as your initial post dates a bit).
Cheers and thanks for triggering this discussion,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.