orderby="random” and pagination
Posted: 20 September 2007 06:04 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  215
Joined  01-14-2006

I could only find old posts on this subject…

An activity directory we have has around 180 entries, and to be fair to each activity provider with exposure on the site, we need to randomize the results. I don’t really want to list 180 activities on one page…

Does anyone know a way to can paginate random results?..

In my head i’m thinking a query to produce all the entry ids required, and breaking it up into chunks of say 20 ids and populating the entry_id="13|42|147etc" parameter with each chunk per page, as this code works:

{exp:weblog:entries entry_id="112|111|110" orderby="random"}
{title}
<br />
{/exp:weblog:entries}

alas my coding skills are so poop i wouldn’t know where to begin with passing the info between the pages, and creating the next previous links… Any ideas…

Iain

 Signature 

Weblog | New Zealand Web Design Agency

Profile
 
 
Posted: 20 September 2007 07:17 AM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1070
Joined  03-22-2006

Hi Iain,

Without some heavy custom code (most likely an extension) this really is a difficult one. Please add your voice to the feature request for random pagination.

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 20 September 2007 07:23 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  215
Joined  01-14-2006

cool will do,

this looks like pretty interesting temp solution/fix/hack: http://www.frequency-decoder.com/demo/table-sort-revisited/paginate/

 Signature 

Weblog | New Zealand Web Design Agency

Profile
 
 
Posted: 20 September 2007 08:08 AM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  21199
Joined  05-20-2002

That table sort js is slick!  And the_butcher is right- I think this is one for a feature request.  I can think of some options- but none of them are particularly elegant.

 Signature 

AKA rob1

Help Request Tips * Pro Network

Profile
 
 
Posted: 20 September 2007 08:21 AM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  215
Joined  01-14-2006

yeah, its really nice, lightweight too.

elegant… can’t be any worse than outputting 180 entries on a page - would love to know what ideas you have Robin.

oh, fyi the ‘Help Request Tips’ on your signature goes to a ‘You are not authorized to perform this action’ page Robin.

Iain.

 Signature 

Weblog | New Zealand Web Design Agency

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 61013 Total Logged-in Users: 16
Total Topics: 73782 Total Anonymous Users: 14
Total Replies: 398033 Total Guests: 401
Total Posts: 471815    
Members ( View Memberlist )
Newest Members:  Kaleb TracysofwanfurqiekohyeaHRAFFAndrew Doranphantom-am0azamblituxh-nakamura