@@ -50,7 +50,7 @@ you would like to use:
50
50
51
51
@cached_property
52
52
def my_placeholder(self):
53
- return get_placeholder_from_slot(self.placeholders, "my_placeholder ")
53
+ return get_placeholder_from_slot(self.placeholders, "slot_name ")
54
54
55
55
# your methods
56
56
@@ -61,7 +61,7 @@ placeholders. The utility function
61
61
based on its slot name.
62
62
63
63
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 `,
65
65
which determines which plugins may be inserted into this placeholder.
66
66
67
67
.. note ::
@@ -97,16 +97,16 @@ amongst the translated fields:
97
97
placeholders = PlaceholderRelationField()
98
98
99
99
@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 ")
102
102
103
103
def __str__(self):
104
104
return self.title
105
105
106
106
Templates
107
107
~~~~~~~~~
108
108
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
110
110
the :mod: `~cms.templatetags.cms_tags ` template tag library:
111
111
112
112
.. code-block :: html+django
@@ -115,7 +115,7 @@ the :mod:`~cms.templatetags.cms_tags` template tag library:
115
115
116
116
{% render_placeholder mymodel_instance.my_placeholder "640" %}
117
117
118
- The :ref : `render_placeholder ` tag takes the following parameters:
118
+ The :ttag : `render_placeholder ` tag takes the following parameters:
119
119
120
120
- :class: `~cms.models.fields.PlaceholderField ` instance
121
121
- ``width `` parameter for context sensitive plugins (optional)
@@ -173,7 +173,7 @@ a second template, only needed for rendering the structure mode, called, say,
173
173
.. code-block :: html+django
174
174
175
175
{% load cms_tags %}
176
- {% placeholder "placeholder_1 " %}
176
+ {% placeholder "slot_name " %}
177
177
178
178
The important bit is to include all slot names for the model in the structure template.
179
179
Other parts of the templte are not necessary.
@@ -199,7 +199,8 @@ Registering the model for frontend editing
199
199
.. versionadded :: 4.0
200
200
201
201
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:
203
204
204
205
.. code-block ::
205
206
@@ -215,7 +216,7 @@ Adding content to a placeholder
215
216
-------------------------------
216
217
217
218
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
219
220
page's URL.
220
221
221
222
This will make the frontend editor top banner appear (and if necessary will require you
0 commit comments