Page 1 of 2
News Problem CMSMS 1.1
Posted: Sun Jul 15, 2007 6:03 pm
by brettkan
Just upgraded to CMSMS 1.1 and my (front page) - News page is FUBAR
string(80) "Smarty error: unable to read resource: "module_db_tpl:News;summarynewsfirst.tpl""
I am using different templates for parts of the page and it looks like it cant read the templates - text for the page looks like this:
{news start='0' number='1' summarytemplate='newsfirst.tpl'}
{news start='1' number='2'}
{news start='3' number='2'}
Older news items
{news start='5' number='10' summarytemplate='newslist.tpl'}
... and newsfirst.tpl looks like this:
{foreach from=$items item=entry}
{$entry->titlelink}
{if $entry->summary}
{eval var=$entry->summary}
{$entry->morelink}
{else if $entry->content}
{eval var=$entry->content}
{/if}
{if $entry->formatpostdate}
{/if}
{/foreach}
Help appreciated... desperately needed...
LAMP server running php 4.4.3 MySQL 4.1.22 Linux 2.4.21-47.0.1.ELsmp
Re: News Problem CMSMS 1.1
Posted: Sun Jul 15, 2007 6:07 pm
by moorezilla
I ran into this problem as well.
To fix it, just add templates using the news module itself (two tabs, one for summary and one for detail) with the same names as your existing templates. Cut and paste your old template code into them and voila... fixed.
am
Re: News Problem CMSMS 1.1
Posted: Sun Jul 15, 2007 7:00 pm
by brettkan
moorezilla wrote:
To fix it, just add templates using the news module itself (two tabs, one for summary and one for detail) with the same names as your existing templates. Cut and paste your old template code into them and voila... fixed.
Well that was the first thing i tried, but it did not work, I have tried naming the template with and without extension. I have deleted the news directory and rebuild it again, i have repopulated all the news items.
Actually i have noticed that when the names of the templates match - the summarytemplate='newsfirst.tpl' or summarytemplate='newsfirst' then that particular part of the page just disapears, without an error.
Frankly i have never had an upgrade without a problem, maybe thats why this site runs on CMS Made Simple 0.13
Re: News Problem CMSMS 1.1
Posted: Sun Jul 15, 2007 7:33 pm
by moorezilla
Sorry... I don't have any more ideas for you. Perhaps someone else can add a solution to this post?
Re: News Problem CMSMS 1.1
Posted: Sun Jul 15, 2007 7:50 pm
by brettkan
Actually i think it must be a database problem -
when i change
{news start='0' number='1' summarytemplate='newsfirst.tpl'}
{news start='1' number='2'}
{news start='3' number='2'}
Older news items
{news start='5' number='10' summarytemplate='newslist.tpl'}
TO:
{news start='1' number='1' summarytemplate='newsfirst.tpl'}
{news start='2' number='2'}
{news start='4' number='2'}
Older news items
{news start='6' number='10' summarytemplate='newslist.tpl'}
The First item shows up allright, but then shows up again on the #2 slot, and the order is wrong after, also the items after #6 dont show at all.
So you were mostly right - #0 was just not showing up - so leaving a hole at the top of the page- the hole at the bottom of the page i cant explain. I think my database has been slightly screwed for some time, and each upgrade doesnt help. Its not the sort of thing i want to to rebuild from scratch.
Thanks
Re: News Problem CMSMS 1.1
Posted: Mon Jul 16, 2007 8:25 am
by brettkan
But then again - if i put the default {news} into my page, all the items display in the right order.
either i have some syntax problem or the start=x .. {news start='1') is working differently in 1.1.
Does anyone use the start='x' in their news page?
cheers
Re: News Problem CMSMS 1.1
Posted: Tue Jul 17, 2007 2:42 am
by plushtoy99
string(88) "Smarty error: unable to read resource: "module_db_tpl:News;summarytitleonlytemplate.tpl""
I am getting the same error with this code:
{cms_module module="News" number="3" detailpage="News" summarytemplate="titleonlytemplate.tpl"}
Re: News Problem CMSMS 1.1
Posted: Tue Jul 17, 2007 2:50 am
by plushtoy99
It must be a db issue. When I remove .tpl, it works.
Before:
{cms_module module="News" number="3" detailpage="News" summarytemplate="titleonlytemplate.tpl"}
After:
{cms_module module="News" number="3" detailpage="News" summarytemplate="titleonlytemplate"}
Re: News Problem CMSMS 1.1
Posted: Tue Jul 17, 2007 6:24 am
by brettkan
Yes i tried the same, but i think the problem is the "start=x"
I have no problem with:
{cms_module module="News" number="17" detailpage="News" summarytemplate="titleonlytemplate"}
BIG Problem with 3 separate calls to the news module in the page with a start number:
{cms_module module="News" number="1" detailpage="News" summarytemplate="titleonlytemplate"} //* no problem without start, but did have start="0" inserted *//
{cms_module module="News" start="1" number="4" detailpage="News" summarytemplate="maintemplate"}
{cms_module module="News" start="5" number="12" detailpage="News" summarytemplate="endtemplate"}
You can see what i am doing here:
http://www.rnoh.nhs.uk/ (but the page is flat html untill i can fix this)
Perhaps 3 inserts of different templates into one page wont work any more and i will have to find a way of achieving the same thing with one template.
Re: News Problem CMSMS 1.1
Posted: Tue Jul 17, 2007 6:52 pm
by reneh
A "heavy breathing" answer from the dev team:
The problem with start= option for news is found and solved in SVN version now and we're debating a 1.1.1 here (just have rounding up a few more bugs)....
Note:
These bugs would have been found if more had taken the time to test the release candidates...

Re: News Problem CMSMS 1.1
Posted: Fri Jul 27, 2007 12:12 pm
by Peter.Schwab
I think the main problem is, that there is a profound change in NEWS 2.3
The old version worked with summary and detail templates in files, the new one has the templates stored in the database. Apparently nobody cared for backward compatibility and so the same parameter was used for both template types.
My suggestion:
in action.default.php change
Code: Select all
if (isset($params['summarytemplate']))
{
$template = 'summary'.$params['summarytemplate'];
}
echo $this->ProcessTemplateFromDatabase($template);
to
Code: Select all
if (isset($params['summarytemplate']) && substr($params['summarytemplate'], -4) == '.tpl')
{
echo $this->ProcessTemplate($params['summarytemplate']);
}
elseif (isset($params['summarytemplate']))
{
$template = 'summary'.$params['summarytemplate'];
echo $this->ProcessTemplateFromDatabase($template);
}
else
{
echo $this->ProcessTemplateFromDatabase($template);
}
and do the same for action.detail.php, by replacing "summarytemplate" with "detailtemplate".
By doing this, external, file-based templates can still be used, as well as the new database templates.
HTH
+peter+
Re: News Problem CMSMS 1.1
Posted: Tue Aug 14, 2007 9:33 am
by smg-alex
Please tell, how can I patch my CMSMS 1.1
to make my news archives display propertly.
I can't see news using
{news start=6}
Please help.
Re: News Problem CMSMS 1.1
Posted: Tue Aug 14, 2007 3:49 pm
by Dr.CSS
The News now uses templates from db you go to summary templates, the one that shows in the box is just an example and effects nothing only the ones in the lower 'Available Templates' are usable, the one checked as default will be chosen if no template is called in the tag, and click 'Create A New Template' add your old code then call it in your tag {news summarytemplate='nameoftemplate'} w/o .tpl and for new detail template same thing and the call is {news detailtemplate='nameoftemplate'}...
As for the start part haven't used it so no ideas... sorry... EDIT: tried it and no luck
Re: News Problem CMSMS 1.1
Posted: Mon Aug 20, 2007 10:53 am
by xmas3
to: Peter
thanks man, it works fine
Re: News Problem CMSMS 1.1
Posted: Tue Aug 21, 2007 2:46 am
by taufikp
Thanks Peter! Your solution works fine on my site!
How come the developers of the excellent News module missed this?

Backward compatibility should be maintained, otherwise just make another News module instead of upgrading it, IMHO.
The Start parameter is not working anymore. However, the developers already stated that they will include the fix in CMS 1.1.1.
