Wednesday 04 February 2004 10:19:37 am
Hi James Thanks for your help. I was using this to get to a blog's relatd person object - and get the related user object. I used this approach instead of sections because I don't want hundreds of sections. Here's my code - for anyone that may want this in the future.
Cheers Jason {let current_user=fetch('user','current_user') }
{* Retrieve blog owner's user id *}
{let blog_person_rel=$node.object.data_map.blog_owner.content.id} {let blog_person=fetch('content','object',hash('object_id',$blog_person_rel))}
{let blog_user_rel=$blog_person.data_map.person_user.content.id} {let blog_user=fetch('content','object',hash('object_id',$blog_user_rel))} <h1>Blog of {content_view_gui view=text_linked content_object=$blog_person}</h1>
<form method="post" action={"/content/action/"|ezurl}>
<div class="buttonblock">
{section show=$current_user.contentobject_id|eq($blog_user.data_map.user_acc
ount.contentobject_id)}
<input type="hidden" name="NodeID" value="{$node.node_id}" />
<input type="hidden" name="ClassID" value="2">
<input class="button" type="submit" name="NewButton" value="New Article"
>
{/section}
</div> </form>
{section name=Articles loop=fetch('content', 'list',
hash( parent_node_id, $node.node_id,
limit, $page_limit,
sort_by,array(array(published,false())),
offset, $view_parameters.offset) ) }
<p>
<b><a href={concat('content/view/full/', $Articles:item.node_id,'/')|ezurl}>{
$Articles:item.name|wash}</a></b>
</p>
<p>
{attribute_view_gui attribute=$Articles:item.data_map.intro}
</p>
<br> {/section}
{/let} {* end of fetch blog_user *} {/let} {* end of fetch blog_user_rel *}
{/let} {* end of fetch blog_person *} {/let} {* end of fetch blog_person_rel *} {/let} {* end of fetch current user *}
|