10000 Improved static placeholder documentation by evildmp · Pull Request #6315 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

Improved static placeholder documentation #6315

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 1 commit into from
Apr 5, 2018
Merged
Show file tree
Hide file tree
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 13 additions & 3 deletions docs/introduction/templates_placeholders.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ If you switch to *Structure* mode, you'll see the new placeholders available for

.. image:: /introduction/images/new-placeholder.png
:alt: the new 'splashbox' placeholder
:width: 600
:align: center


Expand Down Expand Up @@ -98,8 +97,19 @@ single page, we should add it to our base template
{% static_placeholder 'footer' %}
</footer>

Save the template and return to your browser. Refresh any page in ``Structure`` mode, and you'll
see the new static placeholder. If you add some content to it in the usual way, you'll see that it
Save the template and return to your browser. Refresh any page in Structure mode, and you'll
see the new static placeholder.

.. image:: /introduction/images/static-placeholder.png
:alt: a static placeholder
:align: center

.. note::

To reduce clutter in the interface, the plugins in static placeholders are hidden by default.
Click or tap on the name of the static placeholder to reveal/hide them.

If you add some content to the new static placeholder in the usual way, you'll see that it
appears on your site's other pages too.


Expand Down
Binary file added docs/reference/images/placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/reference/images/static-placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 10 additions & 8 deletions docs/reference/templatetags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ Placeholders
placeholder
-----------

.. versionchanged:: 2.1

The placeholder name became case sensitive.

The ``placeholder`` template tag defines a placeholder on a page. All
placeholders in a template will be auto-detected and can be filled with
plugins when editing a page that is using said template. When rendering, the
Expand All @@ -37,6 +33,10 @@ Example::

{% placeholder "content" %}

.. image:: /reference/images/placeholder.png
:alt: a placeholder named 'content'
:align: center

If you want additional content to be displayed in case the placeholder is
empty, use the ``or`` argument and an additional ``{% endplaceholder %}``
closing tag. Everything between ``{% placeholder "..." or %}`` and ``{%
Expand Down Expand Up @@ -81,8 +81,6 @@ context variables and change some other placeholder behaviour.
static_placeholder
------------------

.. versionadded:: 3.0

The ``{% static_placeholder %}`` template tag can be used anywhere in a template element after
the ``{% cms_toolbar %}`` tag. A static placeholder instance is not bound to any particular page
or model - in other words, everywhere it appears, a static placeholder will hold exactly the same
Expand All @@ -101,10 +99,14 @@ Example::

{% static_placeholder "footer" %}

.. image:: /reference/images/static-placeholder.png
:alt: a static placeholder
:align: center

.. warning::
.. note::

Static placeholders are not included in the undo/redo and page history pages
To reduce clutter in the interface, the plugins in static placeholders are hidden by default.
Click or tap on the name of the static placeholder to reveal/hide them.

If you want additional content to be displayed in case the static placeholder is
empty, use the ``or`` argument and an additional ``{% endstatic_placeholder %}``
Expand Down
0