makari Posted June 20, 2015 Posted June 20, 2015 Hallo, to show some featured objects on the front page, I use a field 'featured'. To show the newest first, I do this: foreach($pages->find("featured=1, sort=-date") as $Objekt) { ... ; } Tested it with sort=date | sort=-date, but there is no effekt to the output. What's wrong? Thank you
LostKobrakai Posted June 20, 2015 Posted June 20, 2015 Is there a field datefield named "date" in that page? If not you either need to create it or use one of these, depending on your usecase: "created" or "modified". 1
makari Posted June 20, 2015 Author Posted June 20, 2015 long version: Now I use a Field named 'featured' with type 'Page' on the frontpage template - so the custumer can combine a set of featured objects on one place... foreach($page->featured->sort("-created") as $Objekt) { ... ; }
JeevanisM Posted May 29, 2020 Posted May 29, 2020 On 6/20/2015 at 7:05 PM, LostKobrakai said: Is there a field datefield named "date" in that page? If not you either need to create it or use one of these, depending on your usecase: "created" or "modified". thanks, got useful now.
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