Hello everyone,
I'm trying to remove the navigation from the partials/form template in an inherited theme from Quark.
Probably not a complex problem, but I'm at a loss here!
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Solved by pamtbaau View solution
Hello everyone,
I'm trying to remove the navigation from the partials/form template in an inherited theme from Quark.
Probably not a complex problem, but I'm at a loss here!
@PurpleRoom, You can't remove the navigation from the form template, because the navigation is part of the partials/base.html.twig template.,, ;-)
What you can do in base.html.twig, is surrounding the section that generates the navigation with something like:
{% if page.template != 'form' %}
...
{% endif %}
Assuming you are using the form plugin's default template, I would copy that into your inherited theme's templates directory. This inherits from partials/base.html.twig. Then simply override the header_navigation block with nothing:
{% extends 'partials/base.html.twig' %}
{% block content %}
{{ content|raw }}
{% include "forms/form.html.twig" %}
{% endblock %}
{% block header_navigation %}{% endblock %}
If that duplication of the content block bothers you (it does me), there are ways to inherit the form template from the plugin rather than overriding it, but the sensible thing to do is live with it :)
Many thanks to both of you @hughbris and @pamtbaau for your replies, and apologies for not responding much earlier.
This time I ended up using your suggested solution, @pamtbaau
Again, thanks a lot!
Log in to reply.
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 2 | 56 | 13 hours ago | ||
| 2 | 61 | 16 hours ago | ||
| 1 | 32 | 17 hours ago | ||
| 2 | 66 | 5 days ago | ||
| 2 | 59 | 5 days ago |