Jump to content

pagination problem


Frank Vèssia
 Share

Recommended Posts

I have a page with a product listing, 10 each page. In this page i have a sidebar with the latest 10 designers. When i go to page 2 also the designers listing changes my list because for listing the designers i use the same method, limit=10 and sort=-id. Is there a way to block the pagination of this list? (the designers template has the pagination enabled because i have a designers page also and i need a pagination there)

Link to comment
Share on other sites

A couple more things I wanted to add now that I'm at the computer (rather than the cell phone).

There are more details about pagination here:

http://processwire.com/api/modules/markup-pager-nav/

There's more information specific to your question under the section called "Are there any side effects?"

The other thing I wanted to mention was your use of sorting by "id". The id is not something that you can necessarily count on 100% for sorting, because it's generated by MySQL. For the most part it's probably going to give you the result you want (at least in the short term), but it's also possible that it will be out of order from your other IDs (it all depends on MySQL and whether it ever reuses old IDs). This may never be an issue. But if you want to play it safe, you may be better off sorting by "-created" (date created) rather than "-id". I believe it will give you the same result you are expecting, but without the risk of relying upon a MySQL id.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...