Forums / Developer / How to update lists?
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/
Monday 27 April 2009 5:06:33 am
Thanks Jani,
You saved my life.
It´s ok now!
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