DrQuincy Posted 9 hours ago Share Posted 9 hours ago I have a template that has a date field attached to it and I use this to reverse sort items. This works great for my blog feed. However, I want to use the same template for an events field. To save me managing an entirely separate template, is there a hook I can use that will uncheck the “reverse sort” checkbox dyanically? So: /blog/ sorts children per the template settings, most recent first /events/ uses a hook to display pages date order ascending Note I am only referring to the site tree in the admin. Obviously, on the front end I can easily use selectors to get the desired result. Thanks. Link to comment Share on other sites More sharing options...
da² Posted 6 hours ago Share Posted 6 hours ago Hi, You don't need a hook, you can sort children on the parent page: Link to comment Share on other sites More sharing options...
DrQuincy Posted 6 hours ago Author Share Posted 6 hours ago Thanks but I want to use different sorting dynamically though to avoid adding a separate template. One is news, most recent first. The other is events where the date would be ascending since the dates would be in the future. I hope that makes sense. Link to comment Share on other sites More sharing options...
da² Posted 5 hours ago Share Posted 5 hours ago (edited) Yes, you can do it by changing the parent page template sorting option. The child template doesn't change, only the sort option on parent page template. /blog/ sorts children: most recent first /events/ sorts children: date order ascending Edited 5 hours ago by da² 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