How to update lists?

Author Message

Daniel Lopes

Friday 24 April 2009 10:00:44 am

I wrote the code below:

{def $my_list=fetch('content','list',
                             hash('parent_node_id',95,sort_by',array('modified',false()),
                             'attribute_filter',array(array('news/featured','=',1)), 
                             'class_filter_type', 'include', class_filter_array, array('news')))}

{foreach $my_list as $node}
  {attribute_view_gui attribute=$node.data_map.categoria}
  <a href="{$node.url|wash}">{attribute_view_gui attribute=$node.object.data_map.title}</a>
  <br />
             {$node.object.modified|l10n(shortdate)}
  <br />
{/foreach}

But the list does not update when I insert a new item and I refresh the page.
What can I do?

Regards,

Jani Tarvainen

Saturday 25 April 2009 10:47:49 pm

Sounds like a caching issue. Try setting off the view cache by inserting the following snippet on the first line of the template:

{set-block scope=global variable=cache_ttl}0{/set-block}

--
http://ezpublish.fi/

Daniel Lopes

Monday 27 April 2009 5:06:33 am

Thanks Jani,

You saved my life.

It´s ok now!

Jani Tarvainen

Tuesday 28 April 2009 9:55:26 am

Great to hear :)

Just remember that turning off View Caching takes its toll on performance. So if you run into trouble take a look at Smart View Cache Cleaning: http://ez.no/doc/ez_publish/technical_manual/4_0/features/view_caching/smart_view_cache_cleaning

--
http://ezpublish.fi/

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

Main resources:

Total runtime0.7192 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 588.9297152.6094
Module start 'layout' 0.00680.0035 741.539139.4141
Module start 'content' 0.01020.7075 780.9531551.5391
Module end 'content' 0.71770.0015 1,332.492212.5000
Script end 0.7192  1,344.9922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.5019160.0002
Check MTime0.00140.1977160.0001
Mysql Total
Database connection0.00110.150010.0011
Mysqli_queries0.659191.6381600.0110
Looping result0.00060.0855580.0000
Template Total0.686595.520.3433
Template load0.00220.308120.0011
Template processing0.684395.140220.3421
Template load and register function0.00010.013810.0001
states
state_id_array0.00070.091810.0007
state_identifier_array0.00070.092620.0003
Override
Cache load0.00180.2522220.0001
Sytem overhead
Fetch class attribute can translate value0.00080.116420.0004
Fetch class attribute name0.00120.169660.0002
XML
Image XML parsing0.00320.438220.0016
class_abstraction
Instantiating content class attribute0.00000.002780.0000
General
dbfile0.00300.4214220.0001
String conversion0.00000.001440.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/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: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs