SebastianP Posted June 1, 2017 Share Posted June 1, 2017 Hi, for a news blog I select the articles by template and sort by post_date: "template=article, sort=-post_date". Also I have a page reference field, wich holds a manually selection of some of this articles. Is there a way to customize the selector string so the manually selected articles come as the first entries? Because of some issues with the pagination I don't want merge two page arrays. Thank you, regards Sebastian Link to comment Share on other sites More sharing options...
LostKobrakai Posted June 1, 2017 Share Posted June 1, 2017 That's not possible as you can only sort by values in a single column (in the db). You might try to use this: https://github.com/LostKobrakai/Paginator 1 Link to comment Share on other sites More sharing options...
Robin S Posted June 2, 2017 Share Posted June 2, 2017 The Paginator module is very nice solution. Another approach would be to add a "featured" checkbox to the article template. Then you use a Pages::saveReady() hook to keep the checkbox and the Page Reference field in sync - if an article is added to the Page Reference field you set the checkbox to 1 and vice versa. You could set the checkbox inputfield to hidden if you only want to use the Page Reference field to select featured articles. Then your articles selector would be "template=article, sort=featured,-post_date" 2 Link to comment Share on other sites More sharing options...
SebastianP Posted June 2, 2017 Author Share Posted June 2, 2017 Thank you both! I have found now another solution for my problem with the use of urlSegments. Regards Sebastian 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