8000 Consistently name "slot" "slot_name" · django-cms/django-cms@7afa967 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7afa967

Browse files
fsbraunmarksweb
authored andcommitted
Consistently name "slot" "slot_name"
1 parent 93cfe79 commit 7afa967

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

docs/how_to/01-placeholders.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ you would like to use:
5050
5151
@cached_property
5252
def my_placeholder(self):
53-
return get_placeholder_from_slot(self.placeholders, "my_placeholder")
53+
return get_placeholder_from_slot(self.placeholders, "slot_name")
5454
5555
# your methods
5656
@@ -61,7 +61,7 @@ placeholders. The utility function
6161
based on its slot name.
6262

6363
The ``slot`` is used in templates, to determine where the placeholder's plugins should
64-
appear in the page, and in the placeholder configuration :ref:`CMS_PLACEHOLDER_CONF`,
64+
appear in the page, and in the placeholder configuration :setting:`CMS_PLACEHOLDER_CONF`,
6565
which determines which plugins may be inserted into this placeholder.
6666

6767
.. note::
@@ -97,16 +97,16 @@ amongst the translated fields:
9797
placeholders = PlaceholderRelationField()
9898
9999
@cached_property
100-
def placeholder_1(self):
101-
return get_placeholder_from_slot(self.placeholders, "placeholder_1")
100+
def my_placeholder(self):
101+
return get_placeholder_from_slot(self.placeholders, "slot_name")
102102
103103
def __str__(self):
104104
return self.title
105105
106106
Templates
107107
~~~~~~~~~
108108

109-
To render the placeholder in a template you use the :ref:`render_placeholder` tag from
109+
To render the placeholder in a template you use the :ttag:`render_placeholder` tag from
110110
the :mod:`~cms.templatetags.cms_tags` template tag library:
111111

112112
.. code-block:: html+django
@@ -115,7 +115,7 @@ the :mod:`~cms.templatetags.cms_tags` template tag library:
115115

116116
{% render_placeholder mymodel_instance.my_placeholder "640" %}
117117

118-
The :ref:`render_placeholder` tag takes the following parameters:
118+
The :ttag:`render_placeholder` tag takes the following parameters:
119119

120120
- :class:`~cms.models.fields.PlaceholderField` instance
121121
- ``width`` parameter for context sensitive plugins (optional)
@@ -173,7 +173,7 @@ a second template, only needed for rendering the structure mode, called, say,
173173
.. code-block:: html+django
174174

175175
{% load cms_tags %}
176-
{% placeholder "placeholder_1" %}
176+
{% placeholder "slot_name" %}
177177

178178
The important bit is to include all slot names for the model in the structure template.
179179
Other parts of the templte are not necessary.
@@ -199,7 +199,8 @@ Registering the model for frontend editing
199199
.. versionadded:: 4.0
200200

201201
The final step is to register the model for frontend editing. Since django CMS 4 this is
202-
done by adding a :class:`~cms.app_base.CMSAppConfig` class to the app's `cms_config.py` file:
202+
done by adding a :class:`~cms.app_base.CMSAppConfig` class to the app's `cms_config.py`
203+
file:
203204

204205
.. code-block::
205206
@@ -215,7 +216,7 @@ Adding content to a placeholder
215216
-------------------------------
216217

217218
Placeholders can be edited from the frontend by visiting the page displaying your model
218-
(where you put the :ref:`render_placeholder` tag), then appending ``?toolbar_on`` to the
219+
(where you put the :ttag:`render_placeholder` tag), then appending ``?toolbar_on`` to the
219220
page's URL.
220221

221222
This will make the frontend editor top banner appear (and if necessary will require you

0 commit comments

Comments
 (0)
0