News Problem CMSMS 1.1

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
brettkan

News Problem CMSMS 1.1

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

Re: News Problem CMSMS 1.1

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

Re: News Problem CMSMS 1.1

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

Re: News Problem CMSMS 1.1

Post by moorezilla »

Sorry... I don't have any more ideas for you. Perhaps someone else can add a solution to this post?
brettkan

Re: News Problem CMSMS 1.1

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

Re: News Problem CMSMS 1.1

Post 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
plushtoy99
Forum Members
Forum Members
Posts: 11
Joined: Tue Jan 02, 2007 1:45 am

Re: News Problem CMSMS 1.1

Post 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"}
plushtoy99
Forum Members
Forum Members
Posts: 11
Joined: Tue Jan 02, 2007 1:45 am

Re: News Problem CMSMS 1.1

Post 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"}
brettkan

Re: News Problem CMSMS 1.1

Post 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.
Last edited by brettkan on Tue Jul 17, 2007 6:37 am, edited 1 time in total.
reneh
Dev Team Member
Dev Team Member
Posts: 446
Joined: Tue Nov 28, 2006 8:39 pm
Location: Norway

Re: News Problem CMSMS 1.1

Post 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...  :'(
ReneH 8-)
A search will save you hours waiting for an answer! Image
Peter.Schwab
Forum Members
Forum Members
Posts: 15
Joined: Tue Feb 20, 2007 3:44 pm

Re: News Problem CMSMS 1.1

Post 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+
smg-alex
Forum Members
Forum Members
Posts: 10
Joined: Tue Aug 14, 2007 6:26 am

Re: News Problem CMSMS 1.1

Post 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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: News Problem CMSMS 1.1

Post 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
xmas3
Forum Members
Forum Members
Posts: 41
Joined: Sat Jul 28, 2007 9:22 am
Location: Bratislava / Slovakia

Re: News Problem CMSMS 1.1

Post by xmas3 »

to: Peter
thanks man, it works fine
taufikp
Forum Members
Forum Members
Posts: 27
Joined: Tue May 01, 2007 2:52 am

Re: News Problem CMSMS 1.1

Post by taufikp »

Thanks Peter! Your solution works fine on my site!  ;D

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.  ;)
Last edited by taufikp on Tue Aug 21, 2007 2:52 am, edited 1 time in total.
Locked

Return to “CMSMS Core”