How to publish an extra field as a date?

  • nameviolated
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 3 weeks ago #160 by nameviolated
How to publish an extra field as a date? was created by nameviolated
Hey,

Trying to publish an extra field as a date, ie the Finish Article publishing date. How is it best to do this? Hack SQL?

Please Log in or Create an account to join the conversation.

More
13 years 3 weeks ago #164 by admin
Disclaimer: not sure I grasped the 'extra field as a date' idea.

Anyway, if you want to publish the End Publishing date, there's a clean way to do it: Joomal output override .

Because the publish_down field is generally* available in CP result records, it's easy to display it, without hacking the component and while keeping compatibility in case of updates to the component.
(* some content types don't have such field, but standard Joomla articles do)

In case you are not familiar with override, here's the basic steps:
1) create [tt]html/com_customproperties/show[/tt] directory into your template folder
2) copy [tt]components/com_customproperties/views/show/tmpl/default.php[/tt] into the directory created with step 1)
3) modify the file

You would add at around row 327-350 something like:
Code:
if(isset($row->publish_down)){ echo $row->publish_down != '0000-00-00 00:00:00' ? JHTML::_('date', $row->publish_down, '%Y-%m-%d') : 'Never' ; }
The actual position depends by the view you chose in CP config.

Please Log in or Create an account to join the conversation.

Time to create page: 0.116 seconds