cb2004 Posted June 1, 2016 Posted June 1, 2016 Hi all, hope everyone is well. So, I want to return the results where the text field matches 'a' and sort those by 'price', then display the results where the text field matches 'b' and sort those by 'price'. Is ProcessWire capable of this or do I just need to do a couple of foreach?
WillyC Posted June 1, 2016 Posted June 1, 2016 sorte all.by price ? text=a|b, sort=price sorte.by text thens by price ? text=a|b, sort=text, sort=price 1
cb2004 Posted June 1, 2016 Author Posted June 1, 2016 Ok it got a bit more interesting. Text could have Available, Coming Soon or Not Available with prices. I want them to appear like: Available sorted by price Not Available sorted by price Coming Soon sorted by price Easily done with 3 foreach blocks but was just curious.
LostKobrakai Posted June 1, 2016 Posted June 1, 2016 If the "texts" would be a options/page field then you can sort them in the page tree / field setup accordingly and willyc's last example would still work.
cb2004 Posted June 1, 2016 Author Posted June 1, 2016 That did it, options field and ("sort=dropdown, sort=price")
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