Access User variable from within content

Author Message

ola adigun

Wednesday 31 January 2007 3:07:56 pm

is there an easy way to access current user id / name from within an article for example?
I can do so within template using something like: {$user.contentobject.name}. How can I access this or something equivalent within an article?

thanks.

Ɓukasz Serwatka

Thursday 01 February 2007 12:08:58 am

You can get owner information like:

{$node.object.owner.name} where "owner" is ezcontentobject. You can inspect it like:

{$node.object.owner|attribute(show,1)}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

ola adigun

Thursday 01 February 2007 7:59:11 am

When I do this: {$node.object.owner.name} directly inside the body of an article it just prints it back. I guess that only works within a template. What I need is a way to access that same information within the body of an article content.

Thanks,
Ola

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 19:27:30
Script start
Timing: Jan 18 2025 19:27:30
Module start 'layout'
Timing: Jan 18 2025 19:27:30
Module start 'content'
Timing: Jan 18 2025 19:27:32
Module end 'content'
Timing: Jan 18 2025 19:27:32
Script end

Main resources:

Total runtime1.5924 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 589.1797152.6406
Module start 'layout' 0.00710.0039 741.820339.4766
Module start 'content' 0.01111.5794 781.2969534.0938
Module end 'content' 1.59040.0019 1,315.39068.1250
Script end 1.5923  1,323.5156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.1901160.0002
Check MTime0.00130.0827160.0001
Mysql Total
Database connection0.00080.050410.0008
Mysqli_queries1.535096.3957570.0269
Looping result0.00070.0443550.0000
Template Total1.555797.720.7779
Template load0.00180.113420.0009
Template processing1.553997.585220.7770
Template load and register function0.00010.008010.0001
states
state_id_array0.00110.071110.0011
state_identifier_array0.00110.069820.0006
Override
Cache load0.00150.0924150.0001
Sytem overhead
Fetch class attribute can translate value0.00090.054120.0004
Fetch class attribute name0.00310.193840.0008
XML
Image XML parsing0.00200.127220.0010
class_abstraction
Instantiating content class attribute0.00000.001040.0000
General
dbfile0.00200.1239180.0001
String conversion0.00000.000640.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs