hansv Posted May 24, 2020 Posted May 24, 2020 Hi I use UIKIT3 Sortable at the frontend to make the blocks M1, M2, ... Each block is a page. I can move (sort) the blocks at the frontend, but how can I save the sort-order so the pages at the backend have the same sort-order as at the frontend?
elabx Posted May 25, 2020 Posted May 25, 2020 There is a sort property on pages that can be set: https://processwire.com/api/ref/pages/sort/ So most likely you'll have to use the callbacks in UIkit to sort this out ? 1
hansv Posted May 28, 2020 Author Posted May 28, 2020 @elabx thx for your suggestion. Callbacks in Uikit are not well documented. Do you have an example for 'sortable'?
kongondo Posted May 28, 2020 Posted May 28, 2020 3 hours ago, hansv said: Callbacks in Uikit are not well documented. Do you have an example for 'sortable'? There's these events to hook into: https://getuikit.com/docs/sortable#events. Most likely you want the moved event. Here's some code stolen from the wild and a pen from the said wild: UIkit.util.on('#sortable', 'moved', function (item) { // do stuff }); And a specific example on sort order: https://stackoverflow.com/questions/47549648/uikit-how-to-get-order-with-the-sortable-component 1
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