News Module: parsing {$entry->formatpostdate} into separate outputs

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
dkompany

News Module: parsing {$entry->formatpostdate} into separate outputs

Post by dkompany »

Hi, I saw this question has been asked and was not answered.. maybe it's too elementary, but...

How do I break up the string that {$entry->formatpostdate} outputs into date, month, day, etc?

What I am after is formatting the entry post date into a "day-calendar" look of some blogs, like this:
http://louderthan10.com/

Any ideas, suggestions would be much appreciated...
cyberman

Re: News Module: parsing {$entry->formatpostdate} into separate outputs

Post by cyberman »

Have you tried something like this?

Code: Select all

<span class="month">{$entry->formatpostdate|date_format: %b}</span><br />
<span class="day">{$entry->formatpostdate|date_format: %d}</span><br />
<span class="time">{$entry->formatpostdate|date_format: %H:%M}</span>
http://www.smarty.net/manual/en/languag ... format.php
User avatar
oct4th
Forum Members
Forum Members
Posts: 28
Joined: Wed May 21, 2008 6:33 pm

Re: News Module: parsing {$entry->formatpostdate} into separate outputs

Post by oct4th »

Just found this post...

This works great when you add quotes to cyberman's code above:

{$entry->formatpostdate|date_format:"%b"}

{$entry->formatpostdate|date_format:"%d"}

{$entry->formatpostdate|date_format:"%H:%M"}

Otherwise you get errors.

c
Locked

Return to “CMSMS Core”