Forums / Setup & design / Right menu / node list flexibility

Right menu / node list flexibility

Author Message

laurent le cadet

Thursday 07 April 2005 2:30:14 am

Hi,

I'm trying to build a node list section dependent.

I read this thread ( http://www.ez.no/content/view/full/54577 ) but I don't really understand how to perform that.

In admin you can choose a node list in the right menu toolbar and choose which node to fetch but I can't imagine to go on using this functionnality if the node list is section dependent...

The thread is talking about a switch.
Should we use this method in the node_list.tpl (and how) or hard coded the pagelayout ?

In fact I would like very much to show contextual additional info with the same flexibility than on ez.no right hand menu.

Any help will be appraciate.

Laurent.

Bård Farstad

Wednesday 20 April 2005 1:06:44 am

Hi Laurent,

if you want to have the right hand content context oriented like here on ez.no then you should alter your content model. Here on ez.no we use a class called information page which has the following attributes:
* Title
* Body
* Right info

The right info is simply an XML text field which is displayed to the right, if enabled. We have a checkbox in the class to enable/disable this feature.

This is a simple and flexible solution to this.

--bård

Documentation: http://ez.no/doc

laurent le cadet

Wednesday 20 April 2005 2:33:13 am

Hi Bård,

I nearly did the same by adding a XML field call infos to the standard article.
I tryed to place this...

{section show=$node.object.data_map.infos.content.is_empty|not}
<div class="infos">
{attribute_view_gui attribute=$node.object.data_map.infos}
</div>
{/section}

directly under

{tool_bar name=right view=full}

in the pagelayout. Everything is ok BUT I have to clear the cahe each time I want to see the content ;)

Should I try to make it your way (checkbox or something else) or do you have another syntaxe for the cache problem ?

Laurent.

Bård Farstad

Wednesday 20 April 2005 2:45:22 am

Laurent,

regarding cache: we have this right information in the view (article/folder) template directly. Then the cache is handled like normal objects.

If you place this in the pagelayout then you should cache it with cache-block. But remember to make the node ID part of the cache key. Cache blocks are purged on publishing by default.

--bård

Documentation: http://ez.no/doc

laurent le cadet

Wednesday 20 April 2005 3:32:44 am

you mean :

{cache-block}
{section show=$node.object.data_map.infos.content.is_empty|not}
<div class="infos">
{attribute_view_gui attribute=$node.object.data_map.infos}
</div>
{/section}
{/cache-block}

Could you help me for the node ID and cache key ?

I read that I haven't to specify any Key because it's comon for all case, but it doesn't seems to work that way...

Bård Farstad

Wednesday 20 April 2005 4:03:56 am

Laurent,

You can supply keys as parameters to the cache block. E.g:

{cache-block keys=$node_id} 
... 
{/cache-block}

This is only needed if you have the code placed in pagelayout. If you are using a view template, then caching is already handled by eZ publish.

Information about the cache blocks can also be found here:
http://www.ez.no/ez_publish/documentation/development/kernel/cache_block_optimization

--bård

Documentation: http://ez.no/doc

laurent le cadet

Wednesday 20 April 2005 6:25:20 am

Hi again,

This is ok but persistent. If I print a new article with content in it's "infos" xml field, there still the previous content on right hand :(

Laurent