Hey! I am trying to add a standard partial to a template and I get an unexpected error…
<!-- Missing Template at Path: 'path="./partials/entete.html"' -->
Starting from the cms-boilerplate from GitHub, here is my code :
src/templates/layouts/base.html
{% block header %}
{% global_partial
path="../partials/header_global.html" %}
{% endblock header %}
src/templates/landing-page.html
{% extends "./layouts/base.html" %}
{% block header %}
{% include
path="./partials/header.html" %}
{% endblock header %}
I think he path is right, since using `{% global_partial path=“./partials/header_global.html” %}` works, and both `header.html` and `header_global.html` are in the same folder (`./partials/`).
src/templates/partials/header.html
<!--
templateType: page
isAvailableForNewContent: false
-->
<header class="header sticky-nav">
{# The link below is used for a navigation skipper which allows users navigating the site with their keyboard to skip over the site navigation. More information on the navigation skipper can be found here: https://github.com/HubSpot/cms-theme-boilerplate/wiki/Accessibility #}
<a href="#main-content" class="header__skip">Skip to content</a>
{# Main header #}
<div class="header__container content-wrapper">
{# Header logo column #}
<div class="header__logo header__logo--main">
{% module "site_logo"
path="@hubspot/logo",
img={
"loading": "eager"
},
extra_classes="no-show--max680" %}
{% module "site_logo_mobile"
path="@hubspot/logo",
img={
"loading": "eager"
},
extra_classes="no-show--min680" %}
</div>
{% module "button"
path="../../modules/button",
text="Click button" %}
</div>
</header>
src/templates/partials/header.html
<!--
templateType: global_partial
label: Global Header
-->
<!-- same as header.html -->
The global partial (header_global.html) is working, but the standard partial (header.html) is not! How is this possible?
According to the docs it should be allright as-is : HTML + HubL Templates - HubSpot docs
I don’t want my header to be global because the button is an anchor to the form on the bottom of the page, so it is page related (aka NOT global).
I have tried many things :
- using “include_dnd_partial” instead of “include”
- moving the “include” statement inside “{% block body %}”
- creating a partial `./partials/simple.html` with only a `<p>` tag and import it in multiple ways
- many other things trial and errors…
Nothing is working for standard partials, only the global partial…
What am I missing?
Thanks!