Andreas Kaiser
|
Wednesday 23 July 2008 1:09:28 pm
Hi, I'm using following code inside a template called from the pagelayout.tpl in ezp 4:
{set-block scope=global variable=cache_ttl}0{/set-block}
<div id="banner">
{def $nrbanners=fetch( 'content', 'tree_count', hash( 'parent_node_id', 358, 'class_filter_type', 'include', 'class_filter_array', array('banner') ) )}
{def $randombanner=fetch( 'content', 'tree', hash( 'parent_node_id', 358, 'class_filter_type', 'include', 'class_filter_array', array('banner'), 'offset', rand(0, dec($nrbanners)), 'limit', 1 ) )}
{content_view_gui content_object=$randombanner[0] view=random}
{undef $nrbanners $randombanner}
</div>
This code is working in other sites (same install), but in this case random isn't working. first time loaded object is show every refresh. Any ideas? Anyway with TemplateCache=disabled in site.ini random works.
eZ Partner in Madrid (Spain)
Web: http://www.atela.net/
|
Andreas Kaiser
|
Wednesday 10 September 2008 11:22:36 am
It's not a high load site, so performance is not a problem... Is there any alternative for displaying random content with cache enabled? I've tried "shuffle" extension and same problem...
eZ Partner in Madrid (Spain)
Web: http://www.atela.net/
|