Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Q: How to get the right base url for Breadcrumbs

Started by Muut Archive 11 years ago · 2 replies · 293 views
11 years ago

Hello,
I'm on a steep learning curve and I'm only just at the start!
I have loaded Antimatter as my theme with no template pages other than default.
I have loaded the Breadcrumbs plugin and it is working but I can't figure out what url notation I should put in the default.html.twig so that the breadcrumb works for each of my pages, from home>page>subpage>subsubpage.
I have tried

{% set base_url = page.url %}
{% set feed_url = base_url %}

{% if base_url == '/' %}
{% set base_url = '' %}
{% endif %}

{% if base_url == base_url_relative %}
{% set feed_url = base_url~'/'~page.slug %}
{% endif %}

Am I using too much here? (I lifted it from the Deliver theme.)

What should I be aiming for?

Many thanks, Luke

ps. I like Grav lots but as a newbie, setting up pages (with breadcrumbs, search, etc) without an Admin is a challenge. However, I see it as completely worth the effort. I like getting under the bonnet ('hood' in the US) and things are starting to make sense to me. All support is greatly appreciated.

11 years ago

I think you have to use {{ base_url_absolute }} variable somehow. What exactly is not working in your breadcrumbs plugin?

11 years ago

That's FAST !!! Cheers :)
I think I may have probalem away from the Breadcrumb. See my next post.
I have removed all the url code that I quoted earlier and I still have the menu problem described in my next post.
Thanks again Karol :)

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1328 9 years ago
Archive · by Muut Archive, 9 years ago
2 921 9 years ago
Archive · by Muut Archive, 9 years ago
2 4050 9 years ago
Archive · by Muut Archive, 9 years ago
1 2928 9 years ago
Archive · by Muut Archive, 9 years ago
3 1107 9 years ago