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 · 1022 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 themetman, 1 day ago
6 74 6 hours ago
Support · by TomW, 2 weeks ago
8 286 4 days ago
Support · by alex, 3 months ago
8 703 4 days ago
Support · by Supple, 1 week ago
1 133 5 days ago
Support · by TomW, 2 weeks ago
3 208 6 days ago