Is it possible to render pages with a {% for lil_foo in foo.children %} in date order, like newest to oldest?
Archive
Yup, it's just:
TWIG
{%for lil_foo in foo.children.order('date', 'desc') %}
You are my hero @rhukster! :)
ok, next level.. what if i need to return all the second level child of a page with a for loop in date order.. ? :/
your going to have to put another loop in side that first loop. have a look at the macro in the partials/navigation.html.twig in the Antimatter theme to see how you can do this recursively.
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 0 | 1338 | 9 years ago | ||
| 2 | 927 | 9 years ago | ||
| 2 | 4056 | 9 years ago | ||
| 1 | 2941 | 9 years ago | ||
| 3 | 1112 | 9 years ago |