Left menu with ViewCaching=true

Author Message

Paulo Almeida

Saturday 29 March 2003 10:23:21 am

Hi,

My left_menu.tpl (in the bottom), that i include in pagelayout.tpl, creates an menu with diferent <div> if the section of each node is the same of the actually show node. This executes well if ViewCaching=false. If true give same <div> for all nodes.
Can anyone help me? ViewCaching true is much speedy, so i want try to get a solution without turning it to false, and without making a left_menu static, is it possible?

Thank in advance

Paulo Almeida

left_menu.tpl

{let children=fetch('content','list',hash(parent_node_id,40))}

{* loop children and print name with link *}
{section name=Child loop=$children}
{switch name=sw match=$Child:item.object.section_id}

{case match=$node.object.section_id}
<div class="menuon">
{/case}
{case}
<div class="menuoff">
{/case}
{/switch}
<a href={$Child:item.url_alias|ezurl}>{$Child:item.name}</a>
</div>
{/section}

{/let}

PACPI.COM Internet Consulting
http://pacpi.com

Paulo Almeida

Saturday 29 March 2003 7:19:33 pm

Well i found the solution by myself.
1º the script doesn't worked because with ViewCaching=true the variable $node doesn't exist

2º i can get section_id in variable $module_result, so i don't need $node anymore

3º i found a better way to implement like this:

{let children=fetch('content','list',hash(parent_node_id,40))}
{section name=Child loop=$children}
<div class="menu{cond($module_result.section_id|eq($Child:item.object.section_id),"on","off")}">
<a href={$Child:item.url_alias|ezurl}>{$Child:item.name}</a>
</div>
{/section}

Regards
Paulo Almeida

PACPI.COM Internet Consulting
http://pacpi.com

Tony Wood

Sunday 30 March 2003 11:32:04 pm

Paulo,

You can also use $DesignKeys:used.node To view all DesignKeys use this in the body of your document {$DesignKeys:used|attribute(show, 1)} to show all the variables available.

I hope this helps

Tony

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Paulo Almeida

Monday 31 March 2003 9:22:36 am

Hi

$DesignKeys:used.node is the id, with this i need to fetch the node to get section_id. With $module_result.section_id, is "direct".

Thanks
Paulo Almeida

PACPI.COM Internet Consulting
http://pacpi.com

Mads Buus Jensen

Thursday 12 June 2003 7:40:32 am

Hello,

I've solved it using a big
{let node=fetch('content','node',hash(node_id,$DesignKeys:used.node)) }

...

{/let}
around my whole pagelayout.tpl

Mads Buus Jensen

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 05:19:16
Script start
Timing: Jan 18 2025 05:19:16
Module start 'layout'
Timing: Jan 18 2025 05:19:16
Module start 'content'
Timing: Jan 18 2025 05:19:17
Module end 'content'
Timing: Jan 18 2025 05:19:17
Script end

Main resources:

Total runtime0.8078 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 589.0469152.6250
Module start 'layout' 0.00610.0031 741.671939.4609
Module start 'content' 0.00930.7970 781.1328610.0781
Module end 'content' 0.80630.0014 1,391.210916.7891
Script end 0.8077  1,408.0000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3820160.0002
Check MTime0.00130.1550160.0001
Mysql Total
Database connection0.00070.092610.0007
Mysqli_queries0.738491.4125650.0114
Looping result0.00060.0775630.0000
Template Total0.773895.820.3869
Template load0.00210.254220.0010
Template processing0.771795.537320.3859
Template load and register function0.00010.015110.0001
states
state_id_array0.00100.125910.0010
state_identifier_array0.00090.111020.0004
Override
Cache load0.00180.2226590.0000
Sytem overhead
Fetch class attribute can translate value0.00130.161230.0004
Fetch class attribute name0.00130.164070.0002
XML
Image XML parsing0.00130.165030.0004
class_abstraction
Instantiating content class attribute0.00000.002490.0000
General
dbfile0.00100.1223220.0000
String conversion0.00000.001140.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
9content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 33
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs