Adam Kiss Posted June 19, 2013 Posted June 19, 2013 Hey everyone, Is there a way/have you ever tried to change order of repeater items (based on one of the repeater fields)? Thanks
horst Posted June 19, 2013 Posted June 19, 2013 (edited) Hi Adam, there was a thread some days ago about that repeaters and sorting: http://processwire.com/talk/topic/3788-sorting-pages-by-repeater-fields-first-entry/ Hopefully there is something useful for you to find. Edited June 19, 2013 by horst
Adam Kiss Posted June 19, 2013 Author Posted June 19, 2013 Hm, not only it does not help, I'm now even more confused. It seems that I could call something like $page->repeater->sort('value'), when exporting it, but… that doesn't work. (I realized that I can use sorting as well, don't need reordering) Bah. I hope Ryan/Soma/Kongondo will notice this.
horst Posted June 19, 2013 Posted June 19, 2013 Hm, not only it does not help, I'm now even more confused. ... I'm so sorry. - I did not want this.
kongondo Posted June 19, 2013 Posted June 19, 2013 Hm, not only it does not help, I'm now even more confused. It seems that I could call something like $page->repeater->sort('value'), when exporting it, but… that doesn't work. (I realized that I can use sorting as well, don't need reordering) Bah. I hope Ryan/Soma/Kongondo will notice this. Wow! Adam has put me in privileged company!!?! My two minutes of fame . I couldn't code my way out of a brown paper bag if I was put in one! Hehe. Sorry, your query is way above my pay grade.... 1
Adam Kiss Posted June 19, 2013 Author Posted June 19, 2013 @Horst - it is more of my limited brainpower in this tropical heat, you've linked me to good content though. Thanks. @Kongondo - you're such a disappointment. --- On a more serious note, ->sort() works. But you can enter just one repeater field (not multiple, as I've tried, although that seems to be in the works, as @Ryan noted in the code ), and the field must exist (yeah, that one's on me). 2
horst Posted June 19, 2013 Posted June 19, 2013 @Kongondo - you're such a disappointment. <thats-my-first-lol-post-ever>LOL</thats-my-first-lol-post-ever> 1
ryan Posted June 20, 2013 Posted June 20, 2013 On a more serious note, ->sort() works. But you can enter just one repeater field (not multiple, as I've tried, although that seems to be in the works, as @Ryan noted in the code ), and the field must exist (yeah, that one's on me). What version of ProcessWire are you using? 2.3 and newer (at least) should supporting sorting by multiple fields in WireArray / PageArray.
Adam Kiss Posted June 20, 2013 Author Posted June 20, 2013 What version of ProcessWire are you using? 2.3 and newer (at least) should supporting sorting by multiple fields in WireArray / PageArray. I'm using 2.2.9 ATM, but I'll update ASAP. Thanks Ryan
kongondo Posted June 20, 2013 Posted June 20, 2013 I'm using 2.2.9 ATM, but I'll update ASAP. Thanks Ryan Adam, Adam; 2.2.9? why or why?
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