[SOLVED] News module and missing date

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
wournos
Forum Members
Forum Members
Posts: 40
Joined: Sat Jun 23, 2007 6:23 pm

[SOLVED] News module and missing date

Post 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.
Last edited by wournos on Sat Jan 03, 2009 7:35 pm, edited 1 time in total.
acropia

Re: News module and missing date

Post 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...
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: News module and missing date

Post 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
acropia

Re: News module and missing date

Post 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
wournos
Forum Members
Forum Members
Posts: 40
Joined: Sat Jun 23, 2007 6:23 pm

Re: News module and missing date

Post 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.
dmgd
Forum Members
Forum Members
Posts: 115
Joined: Tue Jun 06, 2006 1:10 pm

Re: News module and missing date

Post 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
Mark
wournos
Forum Members
Forum Members
Posts: 40
Joined: Sat Jun 23, 2007 6:23 pm

Re: News module and missing date

Post 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.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: News module and missing date

Post by RonnyK »

Make sure, that the summary template has the postdate in as well...

Ronny
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: News module and missing date

Post 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...
wournos
Forum Members
Forum Members
Posts: 40
Joined: Sat Jun 23, 2007 6:23 pm

Re: [SOLVED] News module and missing date

Post by wournos »

I had no idea I had to make use of the Summary.
It works now. Thanks.
Locked

Return to “[locked] Installation, Setup and Upgrade”