date format of News module

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
antuanjoseff
Forum Members
Forum Members
Posts: 10
Joined: Thu May 04, 2006 3:17 pm

date format of News module

Post by antuanjoseff »

hi,

I have been trying the dateformat parameter of the news module because I want the day/month/Year format.

The problem is that the dateformat parameter only changes the format of the summarytemplate, and not the detailtemplate.
I tryed to put this {strftime($entry->formatpostdate)}  in the detailtemplate but is throwing an error.

Any suggestion?
thanks in advance
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am
Location: Deatsville, AL

Re: date format of News module

Post by Elijah Lofgren »

antuanjoseff wrote: hi,

I have been trying the dateformat parameter of the news module because I want the day/month/Year format.

The problem is that the dateformat parameter only changes the format of the summarytemplate, and not the detailtemplate.
I tryed to put this {strftime($entry->formatpostdate)}  in the detailtemplate but is throwing an error.

Any suggestion?
thanks in advance
This has been fixed in the SVN version of the News module.

In News SVN in the Options Tab there is a now a "Format to display the article's post date with." blank and if you put something like this in the blank:
%A, %b %d, %Y
Then, in the News Detail template, you can use

Code: Select all

{$entry->formatpostdate}
to get dates like:
Thursday, Jun 29, 2006

The nightly SVN snapshot doesn't seem to be generated anymore on this page: http://dev.cmsmadesimple.org/scm/?group_id=8

You'll either have to check it out with TortoiseSVN or Subversion or wait for the next version of the News module to be released. It requires CMSMS 1.0-svn so if you want to use it you will need to upgrade CMSMS to 1.0-svn also.

I run the SVN version of most of my sites. I have SVN News and CMSMS running here: http://www.elijahlofgren.com/blog/

Hope this helps.
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
mahjong

Re: date format of News module

Post by mahjong »

Too complicated for nothing.

Why not use smarty modifiers ?

Code: Select all

{$entry->postdate|date_format:"%e %B, %Y"}
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am
Location: Deatsville, AL

Re: date format of News module

Post by Elijah Lofgren »

mahjong wrote: Too complicated for nothing.

Why not use smarty modifiers ?

Code: Select all

{$entry->postdate|date_format:"%e %B, %Y"}
I hadn't thought of that. Good idea.  ;)
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
niq

Re: date format of News module

Post by niq »

Thanks - Just what I have been looking for to, to change the date format on the news template.

Using this type of approach:
{$entry->postdate|date_format:"%e %B, %Y"}
alex7575

Re: date format of News module

Post by alex7575 »

Does anyone know how to make a "setLocale" easily for the News module's date?

By default, the date is in english and i want to have it in french and italian or german... :)
mahjong

Re: date format of News module

Post by mahjong »

1) Create a User Defined Tag with the following code inside

Code: Select all

setlocale(LC_TIME, 'french');
.

2) Named it has you wish. For instance, SetToFrench.

3) Insert {SetToFrench} on to top of the page that needs it.
alex7575

Re: date format of News module

Post by alex7575 »

mahjong wrote: 1) Create a User Defined Tag with the following code inside

Code: Select all

setlocale(LC_TIME, 'french');
.

2) Named it has you wish. For instance, SetToFrench.

3) Insert {SetToFrench} on to top of the page that needs it.
Hmmm thanx for the User Tag, I didn't think about it...
The thing that I've already tried to make a "setLocale(LC_TIME,'french');" on the top of my page in the template and it does not do anything on the news date :(

I call the news date with "$entry->formatdate".

Any idea why it does not work?
mahjong

Re: date format of News module

Post by mahjong »

Any idea why it does not work?
You need to apply the patch I've created for the News module so it can process user tags. Developpers are very slow integrating this solution in the official release. They told me they are to busy to notice patch submissions.

If you are not familiar with SVN patches, take a look at this explicite description of the solution.
Last edited by mahjong on Tue Jul 18, 2006 12:52 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: date format of News module

Post by Dr.CSS »

did you use the {literal}your stuff {/literal} tags in the Source botton view to make your tag...
Post Reply

Return to “Tips and Tricks”