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

Page header redaction for not showing breadcrumbs

Started by Muut Archive 11 years ago · 3 replies · 342 views
11 years ago

☆ Hi everyone

I have plugin breacrumbs enabled and working great.

For some pages, I would like to disabled it by a statement it in page header.

I have looked at documentation on github repository and tried:

YAML
breadcrumbs:
    enabled: false

in page header but it did not work.

Any idea?

Thanks in advance ♪

11 years ago

Currently breadcrumbs has no specific page-level logic. You could do it manually via your template file.. say you have:

TWIG
{% if config.plugins.breadcrumbs.enabled %}
    {% include 'partials/breadcrumbs.html.twig' %}
{% endif %}

You could change this to be:

TWIG
{% if not page.header.breadcrumbs.enabled is same as(false) and  config.plugins.breadcrumbs.enabled %}
    {% include 'partials/breadcrumbs.html.twig' %}
{% endif %}

Yes its a bit funky looking, but checking for an optional false value is not as simple as you would think!

11 years ago

I am going to try that with lots of pleasure (I will report also as soon as possible)

Thank you very much for your kind help (always)...

(I like the idea of proposal too) (thanks also for that)

11 years ago

☆ working beautifully ♪ goal reached!

Thanks again

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1352 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4063 9 years ago
Archive · by Muut Archive, 9 years ago
1 2949 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago