J
J
JaineKaminsky2017-12-27 18:21:09
Twig
JaineKaminsky, 2017-12-27 18:21:09

Twig - instead of the content of the elements, the code is displayed. What could be the problem?

{% extends "../../index.html" %}

{% block content %}
  <h1>lorem5</h1>
  <p class="cont1">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque ea omnis harum, molestiae architecto quidem doloribus sint, illum esse maiores nihil quis voluptatibus est mollitia commodi impedit tempora ut. Molestias.</p>
  <p class="cont2">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptas esse necessitatibus inventore accusamus est laboriosam repellendus ut et distinctio, vel, quia nihil beatae optio blanditiis mollitia. Nobis ut blanditiis, sit!</p>
{% endblock %}

paths are correct. does not throw an error, but in the output:
{% block content %} {% endblock %}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
asantat, 2018-01-29
@asantat

I think this happens because there is no variable. You need to include it in double curly braces, and then the content of the block will be displayed. And already in the block template file specify what you need to output.
Alternatively, try removing the content from {% block content %}
And I also think you need to pay attention to the wording of the address in {% extends "../../index.html" %}. Usually extend lower level templates. And check the file extension - it's definitely *.html, not *.html.twig?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question