"Article published by and last updated by"-snippet

"Article published by and last updated by"-snippet

Tuesday 11 November 2003 3:21:49 am - 2 replies

Modified on Tuesday 11 November 2003 3:26:25 am by Valentin Svelland

Author Message

Shurbann Martes

Tuesday 11 November 2003 6:00:20 am

Hello Valentin,

This code should work, but I haven;t test it. Check the comments for explanation

{default content_object=$node.object //original article
content_version=$node.contentobject_version_object} //latest version of article

<p class="byline">

Posted By: {$content_object.owner.name|wash}, //show owner of the original article
{$content_object.published|l10n(datetime)} //show datetime of original article

{section name=modified show=and($content_object.is_published|not(), $content_version|eq(1)} //check if original is not_published (value: "0") and if the status of the latest version is "1", if both are true show section

<br />Modified by: {$content_version.creator.name} //name of creator of the latest version, {$content_version.modified|l10n(datetime)} //datetime of the latest version
</section>

</p>

I don't know if checking for the published value of the original is enough, that's why I'm checking for the status of the latest version too (I think value "1" means everything is fine, and that it is published)

Good luck,
Shurbann

Valentin Svelland

Thursday 13 November 2003 1:09:18 am

Thanks shurbann, your reply was very useful. I've tested it out, made some small changes - and yes - it works!!

Everyone, feel free to use this snippet:
-------------------------------------

{default content_object=$node.object
content_version=$node.contentobject_version_object}

<p class="byline">

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>

-------------------
Good luck! :)

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.