How to publish an extra field as a date?

  • nameviolated
  • Autore della discussione
  • Offline
  • Nuovo Utente
  • Nuovo Utente
Di più
13 Anni 3 Settimane fa #160 da nameviolated
How to publish an extra field as a date? è stato creato da 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?

Si prega Accesso o Crea un account a partecipare alla conversazione.

Di più
13 Anni 3 Settimane fa #164 da 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.

Si prega Accesso o Crea un account a partecipare alla conversazione.

Tempo creazione pagina: 0.151 secondi