Skip to content

Commit 90e53c3

Browse files
rcookefsbraun
andauthored
Update 02-templates_placeholders.rst (#7935)
In a fresh install of 4.1.1 and the start project, I discovered the static aliases placeholder only works inside the content block. I had changed my base.html to use the 3 blocks suggested, so I had to edit that to this before the static aliases showed up: {% block content %} {% placeholder "feature" %} {% placeholder "content" %} {% placeholder "splashbox" %} <footer> {% static_alias "footer" %} </footer> {% endblock content %} Co-authored-by: Fabian Braun <fsbraun@gmx.de>
1 parent 4650905 commit 90e53c3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/introduction/02-templates_placeholders.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,18 @@ Do not forget to add ``djangocms_alias`` to your ``INSTALLED_APPS`` in ``setting
8989

9090
Static aliases are an easy way to display the same content on multiple locations on your website. Static placeholders act almost like normal placeholders, except for the fact that once a static placeholder is created and you added content to it, it will be saved globally. Even when you remove the static placeholders from a template, you can reuse them later.
9191

92-
So let's add a footer to all our pages. Since we want our footer on every single page, we should add it to our **base template** (``mysite/templates/base.html``). Place it near the end of the HTML ``<body>`` element:
92+
So let's add a footer to all our pages. Since we want our footer on every single page, we should add it to our **base template** (``mysite/templates/base.html``). Place it near the end of the HTML ``<body>`` element, and inside a content block:
9393

9494
.. code-block:: html+django
9595
:emphasize-lines: 1,3-5
9696

9797
{% load djangocms_alias_tags %}
9898

99-
<footer>
100-
{% static_alias 'footer' %}
101-
</footer>
99+
{% block content %}
100+
<footer>
101+
{% static_alias 'footer' %}
102+
</footer>
103+
{% endblock content %}
102104

103105

104106
{% render_block "js" %}

0 commit comments

Comments
 (0)