Jump to content

selector "sort" by date and selected id's


SebastianP
 Share

Recommended Posts

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

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"

  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...