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

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

eZ debug

Timing: Jan 18 2025 21:05:02
Script start
Timing: Jan 18 2025 21:05:02
Module start 'layout'
Timing: Jan 18 2025 21:05:02
Module start 'content'
Timing: Jan 18 2025 21:05:03
Module end 'content'
Timing: Jan 18 2025 21:05:03
Script end

Main resources:

Total runtime1.0693 sec
Peak memory usage4,096.0000 KB
Database Queries69

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 589.3516152.6250
Module start 'layout' 0.00580.0034 741.976639.4453
Module start 'content' 0.00921.0583 781.4219598.6719
Module end 'content' 1.06750.0017 1,380.093820.1563
Script end 1.0692  1,400.2500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3143160.0002
Check MTime0.00140.1301160.0001
Mysql Total
Database connection0.00070.067210.0007
Mysqli_queries0.981991.8314690.0142
Looping result0.00080.0756670.0000
Template Total1.036797.020.5184
Template load0.00210.194820.0010
Template processing1.034696.758820.5173
Template load and register function0.00010.010410.0001
states
state_id_array0.00110.099810.0011
state_identifier_array0.00120.108220.0006
Override
Cache load0.00190.1771600.0000
Sytem overhead
Fetch class attribute can translate value0.00360.338420.0018
Fetch class attribute name0.00120.109890.0001
XML
Image XML parsing0.00130.121120.0006
class_abstraction
Instantiating content class attribute0.00010.0054140.0000
General
dbfile0.00220.2013230.0001
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
15content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 39
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs