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 →

Breakdown url with twig

theme

Solved by Karmalakas View solution

Started by Christophe 5 years ago · 2 replies · 1003 views
5 years ago

Hello,

This is my dir-structure

site.be/be/province/city/local

On the 'local'-pages, i want a link to the related city (parent) page:
{{ page.parent.url }} result => ../be/province/city THIS WORKS!

Trying the same adding a link to the related province (grand parent) page, but with no luck.

Reading the docs about routing , but can't find a good solution with a twig.
Someone can help me out with this?

5 years ago Solution

I'd assume {{ page.parent.parent.url }} should work 🤔 Doesn't it?

👍 1
5 years ago

@Karmalakas thanks a lot. works perfect!!!
So easy 😃

Suggested topics

Topic Participants Replies Views Activity
Support · by TomW, 2 weeks ago
8 227 9 hours ago
Support · by alex, 2 months ago
8 667 23 hours ago
Support · by Supple, 5 days ago
1 98 1 day ago
Support · by TomW, 1 week ago
3 159 3 days ago
Support · by TomW, 6 days ago
2 106 5 days ago