Forums / Setup & design / How can I get "Last updated" and "Written by" of an article?

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 <[email protected]> 
Tuesday 20 April 2004 

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

John Doe <[email protected]>, Leandro <[email protected]> 
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