0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00
wagtail/docs/topics
Andy Chosak 5a65cb7554 Expose preview mode to page and template rendering
Currently Wagtail defines `request.is_preview` as a way for both page
rendering and template rendering to modify logic based on whether the
page is being previewed.

If a page supports multiple preview modes, though, the information about
which mode is being previewed isn't made available. So, for example,
it's not possible to customize `Page.serve` or `Page.get_context` based
on a different preview mode. Or, consider customizing
`Page.get_template` so that it uses a different page template depending
on the mode being previewed.

This commit adds `request.preview_mode` so that the mode is available
downstream of previews, both in the page rendering logic and also in the
template itself.

A minor documentation change mentions this new property.
2021-10-14 06:47:26 +10:00
..
search Updates to docs for new database search backend 2021-10-11 20:12:24 +01:00
images.rst Documentation for image rendition properties including full_url 2021-05-17 12:32:19 +01:00
index.md Add titlesonly to reference / topics top-level TOCs 2021-06-18 15:17:24 +01:00
pages.md Fix broken references in Pages topic documentation 2021-08-20 17:08:35 +01:00
permissions.rst Include custom permissions hook documentation 2021-10-01 06:52:43 +10:00
snippets.rst Documentation: Adding Orderable superclass in code example in "Binding Pages to Snippets". If this is not included sorting in InlinePanel won't work so good to include it in documentation. 2020-04-28 16:21:36 +01:00
streamfield.rst Remove outdated versionadded/versionchanged annotations 2021-07-13 17:10:56 +01:00
writing_templates.rst Expose preview mode to page and template rendering 2021-10-14 06:47:26 +10:00