Page 1 of 1

[SOLVED] News 2.3: pagination problem with content type

Posted: Tue Jul 24, 2007 7:46 am
by qzy
Hi there,

I experienced a strange behaviour of news 2.3 builtin pagination. When I use a page template that explicitly includes the

Code: Select all

{cms_module module="news" category="mycategory" pagelimit="10" summarytemplate="mysummarytemplate"}
tag, then pagination works as expected.
But when I use a page template that has the

Code: Select all

{content}
tag, and I set the content type in the page property screen to news, then pagination stops working. However links to next and last pages are there, they both take to the first page.
Has anyone come across this? Any idea to resolve it?


Thanks,
Balint

Re: News 2.3: pagination problem with content type

Posted: Wed Jul 25, 2007 8:59 pm
by dude2k
I just ran into the same problem and another one...

There really seems to be no other solution than using the page type 'Content' and a smarty tag like:

Code: Select all

{news pagelimit="5" category="category"}
{news number="-1"}
in order to get the pagination to work properly.

Now if some one asks what this {news number="-1"} is all about... you might not need it for your site. But this is my little workaround to suppress a database error when using the search module paired with the news categories and the news itself on my site: http://www.neuseen-basketball.de/index.php?page=presse

As you can see I display the news categories beneath the search field in the middle column and the news in the left column. When searching the results are displayed correctly but this somehow also produces the following error message that is displayed right above the news categories:
[glow=red,2,300]Warning: Parameter searchinput is not known... dropped in /.../lib/misc.functions.php on line 1252[/glow]

The error disappears as soon as two news-tags are used in the content section of the page. Using the second smarty tag

Code: Select all

{news number="-1"}
solves this problem just fine.

[SOLVED] Re: News 2.3: pagination problem with content type

Posted: Mon Jul 30, 2007 11:26 am
by qzy
Hi,

our cases are slightly different, I guess. Anyway, after debugging for some time, I found that the problem is in action.default.php, beginning at line 191 (where pagination section starts). All CreateFrontendLink calls lack the inline parameter, which for some reason will turn to true (I was lazy to trace that), and thus prevent pagination from working.
So replacing these calls from

Code: Select all

CreateFrontendLink($id,$returnid,'default',$this->Lang('prevpage'),$params));
to

Code: Select all

CreateFrontendLink($id,$returnid,'default',$this->Lang('prevpage'),$params,'',false,false));
in all occurences between line 191 and 225 resolve the issue.


Balint