Iām working on some kind of blog/archive and I was wondering if there is a way to display a Ā»newĀ« and Ā»editedĀ« div which disappears after a certain time.
I guess there is one but I have no clue how to do so
Iām eager to hear your solutions
kind regards in advance
J
I donāt know how familiar you are with PHP. But displaying a ānewā badge of some sorts is pretty straight forward.
You will need a date field on the article that gets updated when saving/editing and a defined time span when articles are still considered ānewā.
In the articles template you will just need to check wether today is after the date field plus the time span.
If you need help with the actual code, just reply.
Actually it seems quite logical but it doesnāt work. The first line reads:
if actual time ā article time is smaller then 3 days: do something
instead of $date->time Iāve put $article->date(ācā, ādateā)->time to fetch the article time.
Is this correct? What does <?php echo timespan($data->time); ?> mean?