Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

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

Started by Muut Archive 11 years ago · 1 replies · 378 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 Muut Archive, 10 years ago
1 673 1 week ago
Archive · by Deleted User, 9 years ago
0 3043 9 years ago
Archive · by Muut Archive, 9 years ago
2 1983 9 years ago
Archive · by Muut Archive, 9 years ago
2 5337 9 years ago
Archive · by Muut Archive, 9 years ago
1 4134 9 years ago