Author Topic

Rinze Cats

Thursday 22 April 2004 7:17:34 am

Comment40408

hi guys,

this solved my problem indeed. i knew it was supposed to be easy! I also implemented some code to check whether an image has been added. If so, fetch it! First I added the 'let' to my section

{section name=Related loop=$current_node.object.related_contentobject_array}
{let myobject=false}

then I added the following logic

{* get the object relation. *}
{* from the related object, extract the image and the alternative text and create an image tag (if exists*}
  {* check if homepage picture is available, if so proces it *}
  {section show=ne($Related:item.data_map.thumbnail.content.id,'')}
  {set myobject=fetch( 'content', 'object', hash( 'object_id', $Related:item.data_map.thumbnail.content.id ))}
  {set-block name=homepageContent scope=global variable=mythumbnail}
  {* check if the object has been set, if so: create the image tag*}
  {section show=ne($Related:myobject,'')}
	<img src="{$Related:myobject.main_node.data_map.image.content.small.url}" alt="{$Related:myobject.main_node.data_map.caption.content.output.output_text}">
  {section-else}
  {/section}
  {/set-block}
  {section-else}
{/section}

then I added
<i>{$homepageContent:mythumbnail}</i> where I want to show the thumbnail.

I guess the conditional part needs some improvement. suggestions are welcome!

thanx again for the help!
rinze