Frank Vèssia Posted February 23, 2011 Share Posted February 23, 2011 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 More sharing options...
ryan Posted February 23, 2011 Share Posted February 23, 2011 For the results where you don't want pagination, add "start=0" to the selector. So in total it would be: "limit=10, start=0, sort=-id" (though it doesn't matter what order you place these in) Link to comment Share on other sites More sharing options...
Frank Vèssia Posted February 23, 2011 Author Share Posted February 23, 2011 Fine, thanks ;D Link to comment Share on other sites More sharing options...
ryan Posted February 23, 2011 Share Posted February 23, 2011 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 More sharing options...
Frank Vèssia Posted February 23, 2011 Author Share Posted February 23, 2011 Thanks Ryan for you patiente and additional explainations. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now