Forums / Setup & design / Left menu with ViewCaching=true

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

eZ debug

Timing: Jan 18 2025 02:09:22
Script start
Timing: Jan 18 2025 02:09:22
Module start 'content'
Timing: Jan 18 2025 02:09:22
Module end 'content'
Timing: Jan 18 2025 02:09:22
Script end

Main resources:

Total runtime0.1740 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 588.8438180.8359
Module start 'content' 0.00680.0064 769.679797.8672
Module end 'content' 0.01310.1607 867.5469527.8047
Script end 0.1739  1,395.3516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00392.2154200.0002
Check MTime0.00160.9478200.0001
Mysql Total
Database connection0.00060.339610.0006
Mysqli_queries0.122370.24761410.0009
Looping result0.00160.89401390.0000
Template Total0.160292.110.1602
Template load0.00090.541810.0009
Template processing0.159391.507910.1593
Override
Cache load0.00060.369410.0006
Sytem overhead
Fetch class attribute can translate value0.00130.743610.0013
XML
Image XML parsing0.00020.137910.0002
General
dbfile0.00492.8116200.0002
String conversion0.00000.003430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0003 secs