Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

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

Started by Muut Archive 11 years ago · 1 replies · 339 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 2581 9 years ago
Archive · by Muut Archive, 9 years ago
2 1700 9 years ago
Archive · by Muut Archive, 9 years ago
2 4993 9 years ago
Archive · by Muut Archive, 9 years ago
1 3823 9 years ago
Archive · by Muut Archive, 9 years ago
3 1807 9 years ago