Custom published date in CGBlog Topic is solved

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
jakovbak
Forum Members
Forum Members
Posts: 225
Joined: Thu Dec 13, 2012 2:54 pm

Custom published date in CGBlog

Post by jakovbak »

Hello everyone!
I have a question regarding CGBlog published date... I'd like to customize it's appearance but to do so, I need to do something like this:

Code: Select all

{if $entry->postdate}
	<div class="CGBlogSummaryPostdate latest-news-date pull-left mr45">
		<span class="date pull-left">{$smarty.now|date_format:"%d"}</span>
		<span class="month text-uppercase pull-left">{$smarty.now|date_format:"%B"}</span>
		<span class="year">{$smarty.now|date_format:"%Y"}</span>
	</div>
{/if}
Of course, this kind of date format shows today's date always... How can I force it to use each post's date of publishing?
Thank you in advance and keep safe!
jakovbak
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1629
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Custom published date in CGBlog

Post by DIGI3 »

Can you not just use $entry->postdate instead of $smarty.now? Or am I missing something?

Remember that you can use <pre>{$entry|print_r}</pre> in your templates to see what information is available.
Not getting the answer you need? CMSMS support options
jakovbak
Forum Members
Forum Members
Posts: 225
Joined: Thu Dec 13, 2012 2:54 pm

Re: Custom published date in CGBlog

Post by jakovbak »

I'm really not that good in smarty and maybe my explanation was not clear enough. On attached pic you can see what I'm trying to do (design of 'date posted') and the only way to do it - the only one I can think of :!: - is to break it in three parts: day, month, year. But I don't know how to extract it from blog's post.
Attachments
Screen Shot 2020-12-01 at 19.35.20.jpg
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1629
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Custom published date in CGBlog

Post by DIGI3 »

In the sample you provided, replace $smarty.now with $entry->postdate
Not getting the answer you need? CMSMS support options
jakovbak
Forum Members
Forum Members
Posts: 225
Joined: Thu Dec 13, 2012 2:54 pm

Re: Custom published date in CGBlog

Post by jakovbak »

Thank you DIGI3, it works!!! ;D
Attachments
Screen Shot 2020-12-01 at 20.13.39.jpg
Post Reply

Return to “Modules/Add-Ons”