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
Document disabling Diazo via a registry setting instead the traverser. The automatic ajax_load setting didn't make it into Plone (but an alternative which doesn't influence theming).
Copy file name to clipboardExpand all lines: docs/classic-ui/theming/diazo.md
+6-30Lines changed: 6 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -180,19 +180,16 @@ The size of the {file}`rules.xml` file and the number of rules it contains can n
180
180
181
181
### Disable Diazo for AJAX requests
182
182
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.
183
+
When sending an AJAX request to normal browser views in Plone, Plone will respond with an HTML page which normally is also transformed via the Diazo theming engine.
184
+
In some cases this is an unnecessary overhead, if you only want to inject a small snippet of HTML into the page.
185
185
186
186
To prevent this transformation, disable AJAX requests for Diazo themes by using the `ajax_load` HTTP request parameter.
187
187
`ajax_load` is used in Plone to indicate AJAX requests.
188
188
When added to the query string, `ajax_load=1` disables a full page rendering, whereas `ajax_load=0` enables it.
189
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).
195
-
```
190
+
````{versionadded} plonetheme.barceloneta 3.3.0
191
+
In Plone's standard theme plonetheme.barceloneta 3.3.0 the `ajax_load` theme parameter to disable Diazo was added.
192
+
If you use this theme, the next steps are obsolete.
196
193
````
197
194
198
195
Manually add the HTTP request parameter and its value as follows.
@@ -219,25 +216,4 @@ Choose any method to load this change in your theme.
219
216
220
217
### Completely disable Diazo
221
218
222
-
You can fully disable Diazo for your theme.
223
-
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.
225
-
226
-
Add an event subscriber in a {file}`subscribers.py` file in an add-on package.
Then register it in a {file}`configure.zcml` file.
234
-
235
-
```xml
236
-
<subscriber
237
-
for="*
238
-
zope.traversing.interfaces.IBeforeTraverseEvent"
239
-
handler=".subscribers.disable_diazo"
240
-
/>
241
-
```
242
-
243
-
Now Diazo should be disabled for all requests.
219
+
You can fully disable Diazo and plone.app.theming based themes by setting the `plone.app.theming.interfaces.IThemeSettings.enabled` registry entry to `False`.
0 commit comments