main node id of the user

Author Message

Mazen Alsibai

Saturday 12 November 2005 4:38:22 am

Hi:
how can i get the main node id of the user if i have user id?
thanks

Clemens T

Saturday 12 November 2005 7:51:20 am

Do this in your template:

{def $userid=14}
{def $user=fetch('user', '$userid')}
TheUserID:{$user.contentobject.node_id}
{undef $user}
{undef $userid}

If I'm not right try this, so you can look for the node_id:

{def $userid=14}
{def $user=fetch('user', '$userid')}
UserObject:{$user|attribute(show,2)}
{undef $user}
{undef $userid}

greets,
Clemens
ps: hope it helps

Kristof Coomans

Wednesday 16 November 2005 12:15:58 am

The user's ID is the ID of the user's content object:

{def $userid=14}
{def $userobject=fetch( 'content', 'object', hash( 'object_id', $userid ) )}
Main node id: {$userobject.main_node_id}
{undef $userobject}
{undef $userid}

If you want to have the main node instead of the main node's ID, then you can use <i>$userobject.main_node</i>.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.