Forums / Developer / main node id of the user

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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