You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/classic-ui/theming/diazo.md
+34-23Lines changed: 34 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -178,55 +178,66 @@ Sometimes it is easier to override the corresponding template in Plone, build th
178
178
The size of the {file}`rules.xml` file and the number of rules it contains can negatively impact the performance of your site.
179
179
180
180
181
-
### Disabling Diazo for AJAX requests
181
+
### Disable Diazo for AJAX requests
182
182
183
-
You can disable AJAX requests for Diazo themes with the help of the `ajax_load` request parameter.
184
-
This parameter is used in some places throughout Plone to indicate AJAX requests, which normally should not be transformced by Diazo.
185
-
Also, in Plone 6.2 the `ajax_load` parameter will [automatically be added to the request](https://github.com/plone/Products.CMFPlone/pull/4169) for most AJAX requests.
183
+
After sending an AJAX request from the client to Plone, Plone returns a JSON response.
184
+
Normally, this response should not get transformed by Diazo themes, and is usually handled in client-side JavaScript.
186
185
187
-
```{note}
188
-
Note: For Plone versions before 6.2, add the `ajax_load` query string parameter for your AJAX requests, e.g. `?ajax_load=1`.
189
-
For versions 6.2 and later, this is done automatically for most AJAX requests.
186
+
To prevent this transformation, disable AJAX requests for Diazo themes by using the `ajax_load` HTTP request parameter.
187
+
`ajax_load` is used in Plone to indicate AJAX requests.
188
+
When added to the query string, `ajax_load=1` disables a full page rendering, whereas `ajax_load=0` enables it.
189
+
190
+
````{versionadded} Plone 6.2
191
+
In Plone 6.2, the query parameter and its value `ajax_load=1` are automatically added to most AJAX requests by default.
192
+
193
+
```{seealso}
194
+
See the related pull request [Automatically set the ajax_load request parameter, `plone/Products.CMFPlone` #4169](https://github.com/plone/Products.CMFPlone/pull/4169).
190
195
```
196
+
````
197
+
198
+
Manually add the HTTP request parameter and its value as follows.
191
199
192
-
Firs you need a theme-parameter in your {file}`manifest.cfg` file.
200
+
Add a themeparameter to your {file}`manifest.cfg` file.
193
201
194
202
```cfg
195
203
[theme:parameters]
196
204
ajax_load = python:request.get('ajax_load')
197
205
```
198
206
199
-
Then you can disable Diazo for AJAX requests in your {file}`rules.xml` file:
207
+
Then disable Diazo for AJAX requests in your {file}`rules.xml` file.
After that you would need to restart you instance and reload your theme.
206
-
One way is to select another theme and then switch back to your own theme in the theming control panel.
207
-
For a programmatical way, check [this pull request in plonetheme.barceloneta](https://github.com/plone/plonetheme.barceloneta/pull/404).
213
+
Choose any method to load this change in your theme.
214
+
215
+
- Restart your instance.
216
+
- In the {guilabel}`Theming` control panel, select another theme, then switch back to your own theme.
217
+
- For a programmatical way, see [(Re)Introduce the ajax_load theme parameter and skip diazo theming, if set. `plone/plonetheme.barceloneta`#404](https://github.com/plone/plonetheme.barceloneta/pull/404).
218
+
208
219
220
+
### Completely disable Diazo
209
221
210
-
### Completly disable Diazo
222
+
You can fully disable Diazo for your theme.
211
223
212
-
You might want to not use Diazo for your theme and fully disable it.
213
-
This can be done by setting the `X-Theme-Disabled` http header before Diazo gets active, e.g. in a `IBeforeTraverseEvent` event subscriber.
224
+
Set the `X-Theme-Disabled` HTTP header before Diazo gets active, such as in an `IBeforeTraverseEvent` event subscriber, as shown in the following example.
214
225
215
-
In this example we add an event subscriber in e.g. a {file}`subscribers.py` file in a add-on package:
226
+
Add an event subscriber in a {file}`subscribers.py` file in an add-on package.
0 commit comments