Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

How to get children's children path?

Started by Muut Archive 10 years ago · 2 replies · 420 views
10 years ago

Hello. I have a page which creates the gallery from child pages. Child pages have their child pages. I need to get children's child page path.

Example: portfolio page loads all from directory Graphics. Inside Graphics dir there is another dir: Cup.
I need to enter the Cup page from portfolio page by link.

10 years ago

---twig
{% for child in page.children %}
{% for a in child.children %}
{{ dump(a.route) }}
{% endfor %}
{% endfor %}

10 years ago
TWIG

{% for child in page.children %}
    {% for a in child.children %}
        {{ a.url }}
    {% endfor %}
{% endfor %}
---

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1354 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4065 9 years ago
Archive · by Muut Archive, 9 years ago
1 2953 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago