Sunday 07 November 2010 11:21:42 am
Hi there! Here's another one! There is a fetch statement which retrieves the content of a body attribute containing a picture. Did that with another fetch of related objects, inside the main one, this way:
{def $items=fetch('content', 'tree', hash('parent_node_id', 2, .., 'class_filter_type', 'include', 'class_filter_array', array('article')))}
{foreach $itens as $item}
{def $picts=fetch('content', 'related_objects', hash('object_id', $item.object_id))}
{foreach $picts as pict}
{if $pict.class_name|eq('Image')}
{attribute_view_guy attribute=$pict.data_map.image image_class=small}
{break}
{/if}
{/foreach}
{$item.data_map.body.content.output.output_text|strip_tags()||shorten(300, '...')}
{/foreach} Picture and body text are nicely displayed but... The problem is: the text isn't made of the set number of chars but it varies in length, which is pretty strange. It can't depend on the related picture, can it? Anyone can help figure it out?
loredanaebook.it
|