-
-
Notifications
You must be signed in to change notification settings - Fork 176
Document how to disable diazo for ajax requests and completly. #1961
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
base: 6.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Updates the Diazo theming documentation to explain how to:
- Disable Diazo transformations on AJAX requests via the
ajax_load
parameter and<notheme>
rule. - Completely disable Diazo by setting the
X-Theme-Disabled
header in a request event subscriber.
@thet I read all the related PRs and issues to better understand the change, but I wasn't clear about current behavior. Now I have questions.
Please let me know, then I can start a review. Thank you! |
@stevepiercy the docs I added actually apply to all versions plone.app.theming - which uses Diazo. It even applies to Plone 5. The changes in the Barceloneta PR only re-add Diazo disabling for ajax requests, which was present in Plone 5 but fell out somehow while migrating the codebase to Plone 6. And the CMFPlone PR tries to guess if a AJAX request is present and sets the There is one bold claim though:
The PR is not yet merged and actually it tries to guess if there is a AJAX request and there is no guarantee that every AJAX request is detected as such. |
I'm still having a hard time following the changes. Is this accurate?
We'll need to add some MyST admonitions as appropriate.
This gives readers the context they need to understand for which versions of Plone this new documentation applies.
What kind of parameter is
That was another thing that confused me. First, I think it's great that you were the first person to document a feature in Plone 6.x before it was released. That's never happened before. The claim must be accurate, not bold or hopeful. Consider it as a contract with the reader. We could say that it covers scenarios X and Y, but there may be other unknown scenarios that it doesn't cover. |
@stevepiercy I think we do not need to annotate the docs I added with version compatibility notes. Just because it documents how to disable Diazo which was possible since I can remember. The related change in barceloneta only re-adds the disabling diazo transforms for ajax requests to that specific theme. But it's good to know how to do these version annotations. I made another commit which hopefully makes some things clearer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thet I reorganized and rewrote the content somewhat. Would you please take a look at it to make sure I didn't mess up anything? Thank you!
Link to preview changed docs: |
Reorganize and rewrite content for better flow and Plone version context. Fix grammar, spelling, and typos.
…. The automatic ajax_load setting didn't make it into Plone (but an alternative which doesn't influence theming).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few MyST syntax and grammar fixes. Please verify that I didn't mess up the qualification for which version the instructions apply. Thank you!
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. | ||
In some cases this is an unnecessary overhead, if you only want to inject a small snippet of HTML into the page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. | |
In some cases this is an unnecessary overhead, if you only want to inject a small snippet of HTML into the page. | |
When sending an AJAX request to normal browser views in Plone, Plone prepares a response as an HTML page, then normally transforms it via the Diazo theming engine. | |
In some cases this is unnecessary overhead, such as when you want to inject a small snippet of HTML only into the page. |
````{versionadded} plonetheme.barceloneta 3.3.0 | ||
In Plone's standard theme plonetheme.barceloneta 3.3.0 the `ajax_load` theme parameter to disable Diazo was added. | ||
If you use this theme, the next steps are obsolete. | ||
```` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
````{versionadded} plonetheme.barceloneta 3.3.0 | |
In Plone's standard theme plonetheme.barceloneta 3.3.0 the `ajax_load` theme parameter to disable Diazo was added. | |
If you use this theme, the next steps are obsolete. | |
```` | |
```{versionadded} plonetheme.barceloneta 3.3.0 | |
In Plone Classic UI's standard theme, `plonetheme.barceloneta` version 3.3.0, the `ajax_load` theme parameter to disable Diazo was added. | |
If you use this theme version 3.3.0 or later, then the next steps are obsolete. | |
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thet I'd say everyone uses this theme in Classic UI, so let's qualify it with the version number. I think this revision is correct, but please verify. Thank you!
|
||
- Restart your instance. | ||
- In the {guilabel}`Theming` control panel, select another theme, then switch back to your own theme. | ||
- 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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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). | |
- For a programmatic 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). |
|
||
### Completely disable Diazo | ||
|
||
You can fully disable Diazo and plone.app.theming based themes by setting the `plone.app.theming.interfaces.IThemeSettings.enabled` registry entry to `False`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can fully disable Diazo and plone.app.theming based themes by setting the `plone.app.theming.interfaces.IThemeSettings.enabled` registry entry to `False`. | |
You can fully disable Diazo and `plone.app.theming` based themes by setting the `plone.app.theming.interfaces.IThemeSettings.enabled` registry entry to `False`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically 👍
Documentation of a change introduced in plone/plonetheme.barceloneta#404
📚 Documentation preview 📚: https://plone6--1961.org.readthedocs.build/