Forums / Setup & design / Folder attribute is empty when page is reloaded

Folder attribute is empty when page is reloaded

Author Message

Andreas Tremel

Sunday 28 January 2007 7:31:42 am

Hello there!

I'm using EZ Publish v3.8.4.

My goal was to render dynamic meta descriptions for each page in the site.
Therefore I've created a new attribute and encountered an issue/bug? related to caching:

1. I've defined a new text line attribute named "my_attribute" in the folder class.
2. I created a new folder using "Text" as value for "my_attribute" in the backend.
3. I modified the "page_head.tpl" template like his:

<meta name="description" content="{$node.object.data_map.my_attribute.content}" />

When the folder is loaded for the first time in the frontend, the placeholder is filled correctly:

<meta name="description" content="Text" />

However, when the page is loaded for the second time, the placeholder is empty:

<meta name="description" content="" />

When I clear the site cache, the placeholder works. When the page is reloaded, the placeholder again is empty.
Same thing happens when I use another template (e.g. "pagelayout.tpl") or another attribute (e.g. "title").

Has anyone had familiar problems / know a solution? Thank you in advance.

Regards,

Andreas Tremel

Claudia Kosny

Sunday 28 January 2007 10:59:28 am

Hi Andreas

The variable $node is not available in pagelayout.tpl and related templates once a page is cached, so if you really need it, fetch the node at the beginning of pagelayout.tpl or page_head.tpl. Check e.g here: http://ez.no/community/forum/install_configuration/no_more_node_variable_in_pagelayout
(although this is for EZ 3.9, where $node apparently is not there even for the first page load, the solution is the same).

Claudia

Andreas Tremel

Monday 29 January 2007 6:59:03 am

Hi Claudia,

thanks a lot, now it works!

I've posted your solution into another thread, it seems that more useres have encountered the same problem.

Chers,
Andreas

eZ debug

Timing: Jan 30 2025 21:13:32
Script start
Timing: Jan 30 2025 21:13:32
Module start 'content'
Timing: Jan 30 2025 21:13:32
Module end 'content'
Timing: Jan 30 2025 21:13:32
Script end

Main resources:

Total runtime0.1924 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 588.0781370.2734
Module start 'content' 0.00720.0128 958.35161,001.4688
Module end 'content' 0.02000.1723 1,959.82033,891.5391
Script end 0.1923  5,851.3594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00422.1682200.0002
Check MTime0.00120.6238200.0001
Mysql Total
Database connection0.00070.352310.0007
Mysqli_queries0.101452.71231410.0007
Looping result0.00120.60881390.0000
Template Total0.171989.410.1719
Template load0.00080.398610.0008
Template processing0.171288.967910.1712
Override
Cache load0.00060.286910.0006
Sytem overhead
Fetch class attribute can translate value0.00211.078510.0021
XML
Image XML parsing0.00030.154810.0003
General
dbfile0.01226.3526200.0006
String conversion0.00000.002530.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.0001 secs