Tomek Klaudel
|
Friday 26 August 2005 12:14:35 am
Hello everybody, Here is my template code - nothing special.
{section show=$node.object.contentclass_id|eq(18)}
{def $my_node=fetch( 'content', 'node', hash( 'node_id', $node.object.main_parent_node_id) )}
{section name=Rel loop=$my_node.object.related_contentobject_array}
{section show=$Rel:item.name|eq( $my_node.name )}
{attribute_view_gui attribute=$Rel:item.data_map.image image_class=large}
{/section}
{/section}
{section name=Rell loop=$my_node.object.related_contentobject_array max=9}
{attribute_view_gui attribute=$Rell:item.data_map.image image_class=small}
{/section}
{section-else}
{section name=Rel loop=$node.object.related_contentobject_array max=1}
{attribute_view_gui attribute=$Rel:item.data_map.image image_class=large}
{/section}
{section name=Rell loop=$node.object.related_contentobject_array max=9 offset=1}
{attribute_view_gui attribute=$Rell:item.data_map.image image_class=small}
{/section}
{/section}
But can enybody explain me why, when first time after cache flush I'm displaing page, this code generate output as expected, but when I'm refreshing page again this output dissappear? Is this case, that I'm using <i>section</i> deprecated template element in 3.6.1? In addition in other part of my site I have same effect. Thanks tor any suggestions.
|
Tomek Klaudel
|
Friday 26 August 2005 1:12:25 am
I've just tried with new template syntax. I changed:
<li>
{def $pathitem=$module_result.path[2]}
{section show=$pathitem.url}
{section show=is_set($pathitem.url_alias)}
<a href={$pathitem.url_alias|ezurl}>{$pathitem.text|wash}</a>
{/section}
{/section}
<ul>
{def $nn=fetch( 'content', 'node',
hash( 'node_id', $pathitem.node_id ) )}
{def $nodes=fetch( 'content', 'list',
hash( 'parent_node_id', $pathitem.node_id,
'sort_by', array( 'published', false() ),
'class_filter_type', 'include',
'class_filter_array', array( '18' ) ) )}
{foreach $nodes as $node}
<li><a href={$node.url_alias|ezurl}>{$node.name|wash}</a></li>
{/foreach}
</ul>
</li>
to:
<li>
{def $pathitem=$module_result.path[2]}
<a href="#">{$pathitem.text|wash}</a>
<ul>
{def $nn=fetch( 'content', 'node',
hash( 'node_id', $pathitem.node_id ) )}
{def $nodes=fetch( 'content', 'list',
hash( 'parent_node_id', $pathitem.node_id,
'sort_by', array( 'published', false() ),
'class_filter_type', 'include',
'class_filter_array', array( '18' ) ) )}
{foreach $nodes as $node}
<li><a href={$node.url_alias|ezurl}>{$node.name|wash}</a></li>
{/foreach}
</ul>
</li>
And it's still disappearing after refresh... I have TemplateCompile and TemplateCache switched off. Any idea?
|