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

Finding Other Pages

Started by Muut Archive 10 years ago · 5 replies · 480 views
10 years ago

In the Grav documentation found at https://learn.getgrav.org/content/content-pages. It make mention of Finding Other Pages using HTML and find() method. I put the code into MD section of a page and altered it to work with my site information. When I test this page with this code, page display the HTML syntax but does not display the pages found under folder specified. Is this Syntax supposed to go somewhere else?

10 years ago
TWIG

<ul>
{% for p in page.find('/vacations').children if p != page %}
<li><a href="{{p.url}}">{{ p.title }}</a></li>
{% endfor %}
</ul>
---
10 years ago

Thanks that addressed my concern the trick. Where can I see the additional items that can be find in a Page. For example can I display the main graphic of a page in the results?

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1350 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4061 9 years ago
Archive · by Muut Archive, 9 years ago
1 2948 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago