Saturday 15 October 2005 6:54:21 am - 2 replies
Still having problems showing just the current users articles etc..
Does anyone have a working code for this?
I have tried this code
{*?template charset=utf-8?*}
<h1>User articles</h1>
{* Grab some of the content of the node that is being viewed. *}
{let children=fetch( content, list, hash( parent_node_id, $node.node_id,
attribute_filter,
array( array( 'owner', '=', $current_user.contentobject_id ) )) )}
{* LOOP: For each child of the node... *}
{section name=Child loop=$children}
{* Display the content of the child using a line-view template. *}
{node_view_gui view=line content_node=$Child:item}
<hr>
{* End of loop. *}
{/section}
{* End of namespace. *}
{/let}
..and then it returns
Unknown template variable 'current_user' in namespace ''
I am a newbie to this, so its probably something basic....or?
*please help*
Sunday 16 October 2005 12:05:47 pm
Hi:
you have to fetch the current user like this:
{let current_user=fetch('user','current_user')}
<h1>User articles</h1>
{* Grab some of the content of the node that is being viewed. *}
{let children=fetch( content, list, hash( parent_node_id, $node.node_id,
attribute_filter,
array( array( 'owner', '=', $current_user.contentobject_id ) )) )}
{* LOOP: For each child of the node... *}
{section name=Child loop=$children}
{* Display the content of the child using a line-view template. *}
{node_view_gui view=line content_node=$Child:item}
<hr>
{* End of loop. *}
{/section}
{* End of namespace. *}
{/let}
{/let}{*fetch user*}
You must be logged in to post messages in this topic!