Correct date format in a class pattern. HOW?

Correct date format in a class pattern. HOW?

Wednesday 04 June 2003 12:40:25 am - 2 replies

Author Message

Dan Zembrosky

Wednesday 04 June 2003 10:30:35 pm

just got to this problem too, please help, I want to call the day, the month and the year all seperatly because of the way my site designed.

Frode Marton Meling

Wednesday 04 June 2003 11:49:22 pm

I believe it is not possible to do this just in the Object Name pattern. You have to make an override template for the class you created. When you do that you can use a template operator called datetime.

Example:
You have created a class with ID 20.
You then create a template called line_class_20.tpl inside the ...design\<yoursiteaccess>\override\templates\node\view folder (in ver3.1b you also need to update the override.ini.append file)
Then you insert something like this inside the template file:
...
{default node_name=$node.name}
<a href={concat('content/view/full/',$node.node_id)|ezurl}>
$node_name|wash}</a>
{/default}
<i> (Last edited: {$node.object.modified|datetime(custom,"%d/%m-%y %h:%i")})</i>
...
Everytime the class is listed in line view, this template will override the default presentation for the class.

Here you see how I use the datetime operator.
For more info look in the ezSDK. For more info on the datetime format-strings ("%d/%m") look at php homepage.

MartOn

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.