News Module Pagination doesn't work with multiple categories

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.
Post Reply
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

News Module Pagination doesn't work with multiple categories

Post by JimboDavies »

Our CMS Made Simple site has grown to the point where I needed to enable pagination on the News items (yay!).

On our blog page (http://www.stormforce.biz/information-p ... blogs.html) this works fine, but on our news page it doesn't (http://www.stormforce.biz/information-p ... /news.html).

I have traced this fault down to the fact that the news page contains all of our news items that are not in the category 'Blog', whereas our Blog page just contains those that are in the category 'Blog'. This is called on the news page by this line:

Code: Select all

{news summarytemplate='SF_BigNews_2012' detailtemplate='SF_BigNews_2011' category='General,Sailing,Powerboating,Racing,Motor Cruising,Shorebased' pagelimit='12'}
The problem seems to be the commas separating each news item. It generates a pagination link that looks like this:
If I manually delete all the other categories, this link works fine (i.e. to page two of a single category). If I replace the %2C's with commas, it works fine. So, I need to know how to make the pagination code generate links with the commas in as commas, not %20C.

The code that does this is:

Code: Select all

{if $pagecount > 1}
  <p>
{if $pagenumber > 1}
{$firstpage}&nbsp;{$prevpage}&nbsp;
{/if}
{$pagetext}&nbsp;{$pagenumber}&nbsp;{$oftext}&nbsp;{$pagecount}
{if $pagenumber < $pagecount}
&nbsp;{$nextpage}&nbsp;{$lastpage}
{/if}
</p>
{/if}
How do I move this forward?

Thanks!

Jimbo
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: News Module Pagination doesn't work with multiple catego

Post by velden »

Quick and dirty work-around for the 'time being'?

http://www.smarty.net/docs/en/language. ... eplace.tpl

Not tested!

Code: Select all

{if $pagecount > 1}
  <p>
{if $pagenumber > 1}
{$firstpage|replace:'%2C ':','}&nbsp;{$prevpage|replace:'%2C ':','}&nbsp;
{/if}
{$pagetext}&nbsp;{$pagenumber}&nbsp;{$oftext}&nbsp;{$pagecount}
{if $pagenumber < $pagecount}
&nbsp;{$nextpage|replace:'%2C ':','}&nbsp;{$lastpage|replace:'%2C ':','}
{/if}
</p>
{/if}
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

Re: News Module Pagination doesn't work with multiple catego

Post by JimboDavies »

Hmm, I've tested that now and it doesn't work.

I wonder if it's my browser doing it? Interestingly enough commas in the earlier part of the URL get handled fine.

Jiimbo
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

Re: News Module Pagination doesn't work with multiple catego

Post by JimboDavies »

Odd. What that replacement modifier did do was replace all the %2C's with %252C's...!
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

Re: News Module Pagination doesn't work with multiple catego

Post by JimboDavies »

Well, this is definitely not the browser interpreting things differently, I've tested it in a variety of other browsers.

Having checked the news help module, I am correctly separating the categories with Commas.

Has anyone run into this problem before and got a fix that might work?

Kind Regards,

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

Re: News Module Pagination doesn't work with multiple catego

Post by Dr.CSS »

I use jQuery cycle to do pagination instead of built-in pagination...

http://www.vobuzzweekly.com/blog.html
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

Re: News Module Pagination doesn't work with multiple catego

Post by JimboDavies »

Thanks Dr. CSS - I will look into that.

I'm reluctant to put a solution that involves more code/tricks on the site as it's quite slow already, but if the core module doesn't work I suppose it might be the best way.
Post Reply

Return to “CMSMS Core”