?
avatar GreenLion1010
GreenLion1010
26 Nov 2014

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");
?>


<?php endif; ?>

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

avatar GreenLion1010 GreenLion1010 - open - 26 Nov 2014
avatar jissues-bot jissues-bot - change - 26 Nov 2014
Labels Added: ?
avatar sovainfo
sovainfo - comment - 26 Nov 2014

Try $item->params->get('show_create_date')

avatar GreenLion1010
GreenLion1010 - comment - 26 Nov 2014

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

avatar GreenLion1010
GreenLion1010 - comment - 26 Nov 2014

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");
?>


<?php endif; ?>

thank you very much :)

avatar GreenLion1010 GreenLion1010 - change - 26 Nov 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-11-26 13:33:33
avatar GreenLion1010 GreenLion1010 - close - 26 Nov 2014

Add a Comment

Login with GitHub to post a comment