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.

eZ debug

Timing: Jan 18 2025 22:26:29
Script start
Timing: Jan 18 2025 22:26:29
Module start 'layout'
Timing: Jan 18 2025 22:26:29
Module start 'content'
Timing: Jan 18 2025 22:26:29
Module end 'content'
Timing: Jan 18 2025 22:26:29
Script end

Main resources:

Total runtime0.6775 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 589.3047152.6563
Module start 'layout' 0.00650.0054 741.960939.5078
Module start 'content' 0.01190.6643 781.4688586.2109
Module end 'content' 0.67620.0012 1,367.679712.0938
Script end 0.6775  1,379.7734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4903160.0002
Check MTime0.00120.1815160.0001
Mysql Total
Database connection0.00070.108510.0007
Mysqli_queries0.626292.4194620.0101
Looping result0.00060.0873600.0000
Template Total0.646495.420.3232
Template load0.00200.301920.0010
Template processing0.644495.110920.3222
Template load and register function0.00010.013110.0001
states
state_id_array0.00130.192010.0013
state_identifier_array0.00070.109220.0004
Override
Cache load0.00170.2507270.0001
Sytem overhead
Fetch class attribute can translate value0.00040.063830.0001
Fetch class attribute name0.00090.132660.0001
XML
Image XML parsing0.00100.146430.0003
class_abstraction
Instantiating content class attribute0.00000.001570.0000
General
dbfile0.00100.1473220.0000
String conversion0.00000.001840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs