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

Find() by slug instead of /dir/ ??

Started by Muut Archive 11 years ago · 1 replies · 251 views
11 years ago

Trying to do something like:

TWIG
{% set p = pages.find(/pagedir) %}

but in case I wanna move some page directories around later, I'd rather have the flexibility of:

TWIG
{% set p = pages.find(slug-name) %}

I think I'm, once again, missing an intermediate step...

11 years ago

slug by itself is not enough to determine uniqueness, so that is why the route is used to find pages.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1351 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4063 9 years ago
Archive · by Muut Archive, 9 years ago
1 2949 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago