a.masca Posted May 9, 2020 Share Posted May 9, 2020 Hi everyone, I hope all is well in these strange quarantine days. I'm looking for a way to give those who visit a page with a catalogue (a simple list of pages) the possibility to change the order of the catalogue items by clicking on an up / down arrow. so from this: cat1 - page 1 - page 2 should become cat1 - page 2 - page 1 but I can't understand how to use $page-> sort correctly. Obviously I set the sort of cat1 children as a custom sort. Can you help me out? Thanks so much Link to comment Share on other sites More sharing options...
kixe Posted May 10, 2020 Share Posted May 10, 2020 Steps to solve this: create .js file which sends your sort criteria via form and receives the updated page list. Reload page or update content (ajax) get the input (sort criteria) via PW API: $input->post sanitize your input select pages from DB $pages->find('template=xy, parent=xy,sort=criteria1,sort=criteria2, ... and so on); render updated list. 1 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