Author Topic

Paul Forsyth

Wednesday 10 September 2003 1:43:05 am

Comment13484

Try this out. Basically you need to test when there are rel objects and handle it accordingly.

This code isn't tested so ii may have a few typos in there.... Good luck.

{section show=count($node.object.related_contentobject_array)|gt(0)}
<div class="related">
<ul>

{section name=Rel loop=$node.object.related_contentobject_array}

{switch name=RelClass match=$Rel:item.contentclass_id}

{case match=1}
Folder stuff
<li><a href={concat("/content/view/full/",$:item.main_node.node_id)|ezurl}>{$:item.name}</a></li>
{/case}

{case match=2}
Article stuff
Etc
{/case}

{case match=14}
Whatever
{/case}

{/switch}

{/section}

</ul>
</div>
{section-else}
Do something when there no rel objects.
{/section}