eZ Community » Forums » Setup & design » Publish/Creation Date in Object Name...
expandshrink

Publish/Creation Date in Object Name Pattern

Publish/Creation Date in Object Name Pattern

Tuesday 28 February 2012 7:59:26 pm - 3 replies

Hi folks,

I wonder if it is possible to put the publish (creation) date of an object in its name...

I tried <published> and <publish> in the according class field, no luck. These informations belong to some kind of metadata and are not an attribute as the other data_map fellows. I did not find an answer to this in the forums, can anyone give me a hint? 

Kind regards,

frank

Wednesday 29 February 2012 2:47:40 am

Hi Frank,

looking through the code it doesn't seem possible to get the creation date into the object name (via object name pattern in the class), that is of course unless you create an attribute for the class that defaults to 'now' for example.

I'm not sure why you'd want to do that though, because the 'Published' timestamp is already available on every object and is listed in a column in list view in the admin interface.

To have a closer look at how eZPublish resolves the object name from the pattern set in the class definition, have a look at:

kernel/classes/ezcontentclass.php (line 1387-1388)

kernel/classes/eznamepatternresolver.php

kernel/classes/ezcontentobject.php (~ line 609)

cheers,
Ben

Wednesday 29 February 2012 12:49:59 pm

Hi Ben, 

thanks for your suggestions. I think, I'll go for the custom attribute. 

I implemented some kind of "History" objects, their primary attribute being the creation date, I just wanted this to be visible in the object title. Using a custom attribute is just a small detour.

Regards,

frank

Wednesday 29 February 2012 5:15:44 pm

Hi Ben, 

thanks for your suggestions. I think, I'll go for the custom attribute. 

I implemented some kind of "History" objects, their primary attribute being the creation date, I just wanted this to be visible in the object title. Using a custom attribute is just a small detour.

Regards,

frank

You could also use urlfilter, doing so, you can append the date at the end of the "normal url_alias"... limited but it's a solution...

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from