Search

Hi All,

I'm struggling to get the following scenario to work:

I have a news page, with all entries on it. They can be filtered with categories. The categories are assigned in the news section with a selectbox-link field.

I also want pagination to work on that page. To do this I have the following settings for my news page:

Page: News: URL Parameters: cat/p

The attached news data source filters on the Selectbox link with the param {$cat}. And the paginate results is limited to 2 entries per page. And the return page is {$p}.

This works fine, when all url segments are in place. Say, www.site.com/en/news/category/2.

But when someone want's to go to the next page, without having filtered on a category the url looks like this: www.site.com/en/news/2. The result is the {$category} has a value of 2, resulting in nothing.

How can I have symphony know the 2 in this case is not the category but the pagination param when the category segment is missing?

I have read some post's that talk about this issue, but I'm not entirely grasping it. When I use this for example: www.site.com/en/news?p=2. Nothing happens.

Thanks!

Hello Sanity11,

assuming you are adding ?p=2 to the current URL, the corresponding parameter created would be named url-p (you can easily check its name by adding ?debug&p=2 to the current URL—it should be visible in the “params” node of the XML tree), so I think you should change the name of the parameter you’re using in the pagination of the datasource from $p to $url-p, otherwise it won’t work.

Hi theBigMandarino.

Thanks! That solves it. I was missing that little piece of logics :D.

You’re welcome! Glad to hear you were able to solve it!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details