How can I get "Last updated" and "Written by" of an article?

Author Message

Leandro Alves

Thursday 23 February 2006 12:28:48 pm

Hi

In the full view article template I have this code:

{attribute_view_gui attribute=$node.object.data_map.author}
{$node.object.published|l10n(date)}

With an output like this:

John Doe <nospamSPAMFILTER@ez.no> 
Tuesday 20 April 2004 

If I have more than one author I have something like this:

John Doe <nospam@ez.no>, Leandro <nospam@ez.no> 
Tuesday 20 April 2004 

So what should I do to have somenthing without email address:

John Doe
Leandro 
Tuesday 20 April 2004 

How can I get the <b>"Written by"</b> and <b>"Last updated"</b> information of an article?

Written by:
Leandro (05/02/2004 10:30 am)

Last updated by:
Leandro (04/05/2005 3:28 pm)

Thanks in advance!

Leandro

andreas spahr

Friday 24 February 2006 10:27:14 am

Hi Leandro,

you can do this in two ways:
first, if you want to use it only for the article class, make an override for the author attribute:

[article_author]
Source=content/datatype/view/ezauthor.tpl
MatchFile=ezauthor.tpl
Subdir=templates
Match[class_identifier]=article

and change the code as you like it in (remove the email....):

<b>Written by</b><br>
{section var=Authors loop=$attribute.content.author_list sequence=array( bglight, bgdark )}
{$Authors.item.name|wash( xhtml )}&nbsp{*$Authors.item.email|wash( email )*}{delimiter},{/delimiter}
{/section}

The second possibility is not to use the author attribute of the article class and use it for all objects / classes:

        
{default content_object=$node.object 
 content_version=$node.contentobject_version_object}
<p>
Published by: {$content_object.owner.name|wash}, {$content_object.published|l10n(datetime)} 

{section name=modified show=and($content_object.is_published|not(), $node.contentobject_version_object.version|gt(1))} 

	<br />Last modified by: {$content_version.creator.name}, {$content_version.modified|l10n(datetime)}
{/section}
</p>

The second code will only display one author ....
Cheers

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 16:27:00
Script start
Timing: Jan 18 2025 16:27:00
Module start 'layout'
Timing: Jan 18 2025 16:27:00
Module start 'content'
Timing: Jan 18 2025 16:27:01
Module end 'content'
Timing: Jan 18 2025 16:27:01
Script end

Main resources:

Total runtime0.5750 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 589.2734152.6563
Module start 'layout' 0.00490.0023 741.929739.5078
Module start 'content' 0.00720.5662 781.4375470.8672
Module end 'content' 0.57340.0016 1,252.30478.0938
Script end 0.5750  1,260.3984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.5353160.0002
Check MTime0.00120.2157160.0001
Mysql Total
Database connection0.00080.132910.0008
Mysqli_queries0.527891.7881540.0098
Looping result0.00050.0928520.0000
Template Total0.549495.520.2747
Template load0.00220.382520.0011
Template processing0.547295.155720.2736
Template load and register function0.00010.021710.0001
states
state_id_array0.00080.134310.0008
state_identifier_array0.00170.288020.0008
Override
Cache load0.00180.3154270.0001
Sytem overhead
Fetch class attribute can translate value0.00220.380620.0011
Fetch class attribute name0.00130.231120.0007
XML
Image XML parsing0.00020.038420.0001
class_abstraction
Instantiating content class attribute0.00000.001020.0000
General
dbfile0.00070.1282100.0001
String conversion0.00000.001140.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
8content/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: 25
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs