current user node ID and object ID in full view template

Author Message

Eivind Marienborg

Tuesday 07 September 2004 9:16:08 am

I'm trying to collect the node ID and the object ID from the current user, but the $current_user.contentobject.main_node_id and $current_user.contentobject.id doesn't work. It's in an override for full.tpl.

I've grep'ed through the entire desing directory, but can't find any examples of it being used. Can anyone help?

Eivind

Georg Franz

Tuesday 07 September 2004 9:32:59 am

Hi Eivind,

did you initialize the var $current_user?

It's only available by default in the pagelayout.tpl, not in other templates!

So, if you use it in other templates you have to do something like this before:

{default current_user=fetch('user','current_user') }

... 

{/default}

Best wishes,
Georg.

--
http://www.schicksal.com Horoskop website which uses eZ Publish since 2004

Eivind Marienborg

Tuesday 07 September 2004 9:40:24 am

Works great, thanks! :D

Lazaro Ferreira

Tuesday 07 September 2004 10:02:41 am

Hi,

Have you tried fetching it before :

{let current_user=fetch('user','current_user') }
current_user <br />{$current_user|attribute(show)}
{/let}

it shows every bit of current_user info, including node and object id

Lazaro Ferreira
http://www.mzbusiness.com

Lazaro
http://www.mzbusiness.com

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