Show author of a content-object (ie. an article)

Author Message

Jonny Bergkvist

Wednesday 14 May 2003 2:59:53 am

I would like to show the name of the author/creator of every article.

To do this I will modify the template: design/<sitedesign>/override/templates/node/view/full_class_2.tpl.

I can get the numeric value (uid) of the creator with this template-code:
{$content_version.creator_id}

But how do I get the name?

Jonny Bergkvist

Paul Forsyth

Wednesday 14 May 2003 3:47:32 am

Try other attributes for that class. This code will
show all attributes of $content_version:

{$content_version|attribute(show,1)}

You may notice a attribute named 'data_map'. This holds
the attributes for your class 2, so:

{$content_version.data_map|attribute(show,1)}

will show your attributes and values. This is a very helpful
debugging method :)

A better way to display attributes is through:

{attribute_view_gui attribute=$content_version.data_map.name}

This will render your attribute using standard ez code for whatever datatype the attribute happens to be. Text is easy to display but files, images, etc?

Claus Jensen

Wednesday 14 May 2003 4:56:46 am

I think this one is better: {$node.creator.name}

Jonny Bergkvist

Wednesday 14 May 2003 5:37:55 am

Thanx Claus, your solution worked (of course).

My struggle with this was because I made the article I tested against a few weeks ago, and I had forgotten that I made this test-article to test what happened when I deleted the user that created the article !!!

(And the answer to that is that if you delete a user, then the content that the user created get the $content_version.creator set to NULL)

Jonny Bergkvist

Claus Jensen

Wednesday 14 May 2003 5:46:31 am

Aha!! That explains the error messages im getting on one of my pages I think.
Glad to help you... now you helped me right back ;)

claÜs

John van der Boom

Wednesday 14 May 2003 6:49:53 am

How did/do you change the creator of this object (article) using the admin interface?

Or should I adapt the interface of article-editing to do this kind of job?
Why I'm asking?
I noticed that when a person edit the article, {$content_object.creator.name|wash} shows the name of this person and not the first person who wrote it.

Scot Wilcoxon

Friday 16 May 2003 11:12:18 am

I suspect the creator is different for a different version because of the version handling. To get the creator of the original article, perhaps you have to retrieve version 0...or is that 1?

Valentin Svelland

Wednesday 16 July 2003 6:01:36 am

I've got no problem showing the article's author, but what if the article is altered by someone else at a later stage? The the articles gets a new creator it seems. Is there a way to keep the original creators name, and perhaps rather credit the latter author as "Altered by: OthersUsersName"

Valentin Svelland

Tuesday 11 November 2003 3:29:38 am

Anyone know how to keep original authors name, and place other (later) editor's name under a "Modified by:"-header..?

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 30 2025 21:09:07
Script start
Timing: Jan 30 2025 21:09:07
Module start 'layout'
Timing: Jan 30 2025 21:09:07
Module start 'content'
Timing: Jan 30 2025 21:09:09
Module end 'content'
Timing: Jan 30 2025 21:09:09
Script end

Main resources:

Total runtime1.3203 sec
Peak memory usage8,192.0000 KB
Database Queries83

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.2656151.2266
Module start 'layout' 0.00500.0041 739.4922220.7344
Module start 'content' 0.00911.3102 960.22664,622.1719
Module end 'content' 1.31930.0010 5,582.398415.8125
Script end 1.3203  5,598.2109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.3037160.0003
Check MTime0.00140.1033160.0001
Mysql Total
Database connection0.00080.057110.0008
Mysqli_queries1.203391.1355830.0145
Looping result0.00110.0804810.0000
Template Total1.259795.420.6298
Template load0.00220.166220.0011
Template processing1.257595.239320.6287
Template load and register function0.00160.121310.0016
states
state_id_array0.00200.154110.0020
state_identifier_array0.00190.144020.0010
Override
Cache load0.00190.1464470.0000
Sytem overhead
Fetch class attribute can translate value0.00220.164060.0004
Fetch class attribute name0.00550.4138110.0005
XML
Image XML parsing0.00650.488960.0011
class_abstraction
Instantiating content class attribute0.00000.0020130.0000
General
dbfile0.00790.5988220.0004
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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/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: 34
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs