Add a setting to disable preview / view live functionality
See original GitHub issueProblem
I want to run Wagtail as a headless CMS. In my example, I only want to use Wagtail for a mobile app. This means I don’t have a frontend to use the preview functionality for pages.
Proposed solution
Introduce a new setting WAGTAIL_HEADLESS_DISABLE_PREVIEW
that would disable the Preview / View live buttons for pages when set to True
.
For now, there are alternatives like serving a page with some content saying Preview is not supported but more user-friendly would be to not show the buttons at all. Another option is to override some admin templates but this is also not ideal.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to disable Preview Pane in File Explorer - Ablebits
Go to the View tab. To disable the Preview pane, simply click it once. Also, you can use the Alt + P shortcut....
Read more >Preview mode - Optimize Resource Hub - Google Support
We recommend using preview mode on Chrome. Safari users must go to Preferences > Privacy and then clear Prevent cross-site tracking to use...
Read more >How to disable Preview Pane in File Explorer of Windows 11/10
Open Turn off Preview Pane setting; Select the Enabled option; Press the Apply button; Press the OK button. Let's have a look at...
Read more >Enable Preview features to get early access - Power Platform
In a Unified Interface app · Sign in to Power Apps. · Select your environment from the top-right corner, and select Settings (...
Read more >How to Disable the Preview Pane in the Windows 10 Mail App ...
In Microsoft Outlook (2019-2013): Select View > Reading Pane, and then select Off from the drop-down menu. This article explains how to disable...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’d be keen to look at alternatives to adding a new setting - if Wagtail isn’t catering for a particular use-case then we should improve the design of Wagtail to accommodate it, not just add a new setting and conditional on top and call it done.
As @zerolab pointed out on Slack, it would make logical sense that setting
preview_modes
to an empty list should disable previewing - it looks like it’s only failing because of the template-level logic. My preference would be to fix that behaviour.Hi there,
I am currently using Wagtail nightly
2.9.dev20200418
as I wanted to use the “disable preview” feature.The live button is properly hidden, but I ran into the following problem.
Let’s say I define the model SomePage for which I disable the preview.
I create a page from this model and save it has a draft. When I go to the admin home page and click on the button “DRAFT” of the row corresponding to the created page I get the following error.
I also get this error when I click the “VIEW DRAFT” button of the page on the list page view.
It would be nice to hide these buttons for a page when
preview_modes = []
to prevent actions leading to errors.