Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed tag failed when template is in includes #675

Open
unaor opened this issue Apr 6, 2024 · 0 comments
Open

Embed tag failed when template is in includes #675

unaor opened this issue Apr 6, 2024 · 0 comments

Comments

@unaor
Copy link

unaor commented Apr 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant