Home | Products | Consulting | Hosting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
List page numbers & perpage control

 

 


rjbathgate
User

Jun 22, 2008, 11:44 PM

Post #1 of 2 (635 views)
Shortcut
List page numbers & perpage control Can't Post

Hi again,

Got a few questions I'm hoping to pick your brains for...

Question 1:

I have a list page, which has page controls (i.e. Prev / Next / You are viewing page 2 of 11) on it. Is there anyway I can have it display links to each page directly...

for example

Code
Previous - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - Next

I can't just hard code it in to the results page as sometimes there might not be 10 + pages -- for example if we only had5 results pages, links to page 6,7,8,9 and 10 would all be broken.

And ideally I would also like to be able to present an active state on the number which you are on... so somehow would need to have the CMS place a class tag onto the current page number. Is that possible?!!!

Question 2:
On the results list page, I'm trying to build a select/drop down box so user can choose how many results to display page page. In the step 1 of the page, set default is 'perPage' => '10'. Is there anyway to have the select box on change, update this, so user can for example see 20 results page page.

The results list page come as a result of a multi-option search engine, so the reloading of the results with different perPage number need to keep the search engine criteria... this is the crux...!

Question 3:
On the same results listing page as above, I also want a select/drop down where user can change the sorting order (price high/price low etc etc). I have this function working correctly on the search engine leading to the results page and the below code is on my results page:


Code
$orderBy = "";  
if (@$FORM['order'] == 'pricehigh') { $orderBy = "price+0 DESC"; }
if (@$FORM['order'] == 'pricelow') { $orderBy = "price+0"; }
if (@$FORM['order'] == 'alpha') { $orderBy = "title"; }
if (@$FORM['order'] == 'bedrooms') { $orderBy = "bedrooms+0";


To incorporate this same orderby select/drop down box on the actual results page, I can simply have an onchange function to reload the page with appropriate orderby tag -- however as per question 2, the other search engine criteria which has been passed over needs to remain - again, the crux!

In other words, when the page refreshes with new ordering, it needs to go through as, for example:

Code
resultspage.php?price_min=&price_max=&bedrooms_min=&order=pricehigh&reference=&page=2


I hope all the makes sense, and huge thanks and appreciation for you help and advice in advice!!

Cheers,
Rob


Dave
Staff / Moderator


Jun 23, 2008, 9:39 AM

Post #2 of 2 (591 views)
Shortcut
Re: [rjbathgate] List page numbers & perpage control [In reply to] Can't Post

Hi Rob,

See this post for details on create a page number list:
http://www.interactivetools.com/iforum/P62705#62705

For the perpage you can pass that as a form value and set it like this:


Code
$perPage = 10; 
if (@$FORM['order']) { $perPage = (int) $FORM['order']; }

...
'perPage' => $perPage,
...

For question 3, you can add extra arguments on the end of your links, for example:

<?php echo $listDetails['nextPageLink'] ?>&order=<?php echo @$FORM['order']; ?>">

Hope that helps! Let me know if you need more details on any of that. :)

Dave Edis - Senior Developer
interactivetools.com

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Hosting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4