Page 1 of 1

News Module Pagination doesn't work with multiple categories

Posted: Fri Mar 22, 2013 10:46 am
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

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

Posted: Fri Mar 22, 2013 11:25 am
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}

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

Posted: Fri Mar 22, 2013 12:05 pm
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

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

Posted: Fri Mar 22, 2013 12:07 pm
by JimboDavies
Odd. What that replacement modifier did do was replace all the %2C's with %252C's...!

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

Posted: Mon Mar 25, 2013 8:48 am
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

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

Posted: Sat Apr 13, 2013 8:38 pm
by Dr.CSS
I use jQuery cycle to do pagination instead of built-in pagination...

http://www.vobuzzweekly.com/blog.html

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

Posted: Tue Apr 16, 2013 7:56 am
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.