Page 1 of 1
[SOLVED] News module and missing date
Posted: Thu Dec 25, 2008 12:23 pm
by wournos
I have somewhat recently upgraded my cms to the full 1.5.1, and the date has been missing ever since. I have looked through the Wiki News Faq and noticed the change of code. But even after updating my tags with these new ones, the date is still missing. I had to add it by hand to some of my articles.
My site:
http://www.spaceoddity.co.uk/
I only use News Detail for my news. The code is as follows:
Code: Select all
{if $entry->postdate}
<div id="NewsPostDetailDate">
{$entry->postdate|cms_date_format}
</div>
{/if}
<div id="NewsPostDetailContent">
{eval var=$entry->content}
</div>
I have added the squiggly tag (news number='5') to my front page template in the area where I want it. The squiggly (content) tag is used in a separate area on the same page to display a welcome message.
Seeing how I don't want to use News Summary and have a separate page for News Detail, I shouldn't have to combine the news tag with the content tag as the Important comment says in the News Faq. I tried that before noticing it was only needed when using a "more..." link to a different page. It didn't work.
Any ideas of what to do?
I have already read all relevant pages to News and I can't find a solution.
Re: News module and missing date
Posted: Sun Dec 28, 2008 2:19 pm
by acropia
Same problem here...
I noticed there was nog strftime setting in my Global Settings. Don't know if it was set before the upgrade. Even after setting it to %D, there are no dated being showed...
Re: News module and missing date
Posted: Sun Dec 28, 2008 2:29 pm
by RonnyK
Check if the summary-template of News, has postdate as well.... As before the 1.5.1, it would have shown 'formatpostdate', that is now changed to 'postdate', so that is what the template should say.
Ronny
Re: News module and missing date
Posted: Sun Dec 28, 2008 2:31 pm
by acropia
Thanks Ronny:
Just wanted to post:
Just read the News module website (
http://dev.cmsmadesimple.org/projects/newsmodule )
And Ronny Krijt stated:
Date: 2008-12-11 16:34
Posted By: Ronny Krijt (ronnyk)
Check the default template of News, as it shows how it will show. Before 1.5 it
was 'formatpostdate', from 1.5 on it is 'postdate'
Topic Solved imo
Re: News module and missing date
Posted: Sun Dec 28, 2008 3:31 pm
by wournos
As I stated in first post, I have tried postdate but it doesn't work. I read through the Wiki FAQ and relevant writings regarding News (inside the cms) and I still can't get it to work. I even used the updated code in the Default Template section of the News module. It doesn't work. I checked the Global Settings for the time. The code was missing, but even after adding the proper code, the date is still missing (except for the news posts where I adedit by hand) on the first page of my site.
All I want is the News Detail with Date showing on the first page without any Summary or linking to a second page. The FAQ doesn't offer any description of this. Only an 'Important' notice regarding merging News with Content tags if you want a separate page with detail news.
So I'm afraid the topic hasn't been solved at all.
Re: News module and missing date
Posted: Sun Dec 28, 2008 4:02 pm
by dmgd
This works
Code: Select all
{if $entry->postdate}
<div id="NewsPostDetailDate">
{$entry->postdate|cms_date_format}
</div>
{/if}
If not use
Code: Select all
{if $entry->postdate}
<div id="NewsPostDetailDate">
{$entry->postdate|date_format:"%C%M%D"}
</div>
{/if}
Also make sure you are changing the correct template. This was my problem. Both of these options were successful for me.
Mark
Re: News module and missing date
Posted: Fri Jan 02, 2009 9:57 am
by wournos
I tried adding both of these codes to my chosen Detail Template but none of them changed anything.
I'm beginning to think I have misunderstood the Template section in News Help. It says:
Since version 2.3 News supports multiple database templates, and no longer supports additional file templates. Users who used the old file template system should follow these steps (for each file template):
* Copy the file template into the clipboard
* Create a new database template (either summary or detailed as required). Give the new template the same name (including the .tpl extension) as the old file template, and paste the contents.
* Hit Submit
Following these steps should solve the problem of your news templates not being found and other similar smarty errors when you upgrade to a version of CMS that has News 2.3 or greater.
I have no idea what I had with cmsms 1.3.1.
What exactly does this mean? What's the difference between Database template and File template? Does it mean I can't use the templates located in News > Detail Template? Looking at the names of the templates, none have the .tpl extension. I tried to create a template with that extension in the News module but that doesn't work either.
Re: News module and missing date
Posted: Fri Jan 02, 2009 2:55 pm
by RonnyK
Make sure, that the summary template has the postdate in as well...
Ronny
Re: News module and missing date
Posted: Fri Jan 02, 2009 7:51 pm
by Dr.CSS
When using News it will automatically start with a summary template, if not called in the tag it uses the default, so what you need to do is make a new summary template with just the calls you want, date and content, then call it in news tag as the summary template, {news summarytemplate="YourNewTemplate"}...
The change from file templates, that used to be in the modules/News/templates folder, to DB menas that if you used to call them from there you now need to copy the template into the News admin templates tab, like if you had a summary template you would go to News > Summary Templates then click add new template and name it and paste the code in and save it, then in tag call it like above example...
Re: [SOLVED] News module and missing date
Posted: Sat Jan 03, 2009 7:36 pm
by wournos
I had no idea I had to make use of the Summary.
It works now. Thanks.