Skip to content
● Critical PHP security fixes are out: update PHP on your Grav sites. What to do →

Breakdown url with twig

theme

Solved by Karmalakas View solution

Started by Christophe 5 years ago · 2 replies · 877 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 webmasterodp, 2 weeks ago
4 248 2 weeks ago
Support · by nwhitfield, 2 weeks ago
2 213 2 weeks ago
Support · by stell, 4 weeks ago
5 458 3 weeks ago
Support · by gravinator, 2 months ago
5 637 3 weeks ago
Support · by Gravver, 1 month ago
6 430 4 weeks ago