Skip to content

Embed tag failed when template is in includes #675

@unaor

Description

@unaor

in my spring app using spring boot started 3.2.2 i have three templates
layout.html
navbarSubtitle.html
list.html

in my layout i do the following:

<div id="app" hx-ext="response-targets" hx-headers='{&quot;{{_csrf.headerName}}&quot;:&quot;{{_csrf.token}}&quot;}'>
        {% include "base/topbar" %}
        {% include "base/navbar" %}
        {% include "base/navbarSubtitle" %}
        <!-- {% include "base/widgetContainer" %} -->
        <section id="content" class="section is-main-section">
            <!-- {% include "base/graph" %}
            {% include "base/table" %} -->
            {% block content %}{% endblock %}
            {% include "base/footer" %}
            
        </section>

    </div>

and in my navbarSubtitle I do like this:

 <section class="section is-title-bar">
    <div class="level">
      <div class="level-left">
        <div class="level-item">
          <ul>
            <li>Cybernac</li>
            <li>{% block navbarSubtitle %}Test{% endblock %}</li>
          </ul>
        </div>
      </div>
      <div class="level-right">
        <div class="level-item">
          <div class="buttons is-right">
            <a href="https://github.com/vikdiesel/admin-one-bulma-dashboard" target="_blank" class="button is-primary">
              <span class="icon"><i class="mdi mdi-github-circle"></i></span>
              <span>GitHub</span>
            </a>
          </div>
        </div>
      </div>
    </div>
  </section>

the problem is in my list.html

 {% extends "base/layout" %}
    {% embed "base/navbarSubtitle" %}
      {% block navbarSubtitle %} Sites {% endblock %}
    {% endembed %}
    {% block content %}
    {% include "sites/table" %}
        <div id="add"></div>
        <div id="edit"></div>
{% endblock %}

the word Sites is not rendered only the word Test, i noticed that if in my layout.html i remove the include tag and paste the html in there directly this works as expected ,so i think that something is missing in my implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions