8000 docs: Update 02-templates_placeholders.rst by rcooke · Pull Request #7935 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

docs: Update 02-templates_placeholders.rst #7935

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

Merged
merged 2 commits into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions docs/introduction/02-templates_placeholders.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,18 @@ Do not forget to add ``djangocms_alias`` to your ``INSTALLED_APPS`` in ``setting

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.

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:
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:

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

{% load djangocms_alias_tags %}

<footer>
{% static_alias 'footer' %}
</footer>
{% block content %}
<footer>
{% static_alias 'footer' %}
</footer>
{% endblock content %}


{% render_block "js" %}
Expand Down
Loading
0