Hello community,
i try to edit the _item.php from the override folder of the module newsflash, of my template.
i try to show up the creation date of the articles in the newsflash module with the following code:
<?php if ($params->get('show_create_date')) : ?>
<?php
$date = new DateTime($item->created);
echo $date->format("d.m.Y");
?>
but the date does not show up.
if i leave the if statement commented out it works.
So i guess i have the wrong if statement at this place.
how would be the right if statement to check if the setting for creating date in the article is set to "show"?
thank you & kind regards
GreenLion
Labels |
Added:
?
|
thank you for your fast response, sir.
if i try it with your proposal i get this error:
Parse error: syntax error, unexpected '$item' (T_VARIABLE), expecting '(' in /srv/www/vhosts/kubler.ch/httpdocs/templates/as002057/html/mod_articles_news/_item.php on line 25
sorry - i had just a syntax error because of missing ()
thank you for your pillar.
here is the code of my _item.php:
<?php if ($item->params->get('show_create_date')) : ?>
<?php
$date = new DateTime($item->created);
echo $date->format("d.m.Y");
?>
thank you very much :)
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-11-26 13:33:33 |
Try $item->params->get('show_create_date')