J. Campbell
J. Campbell

Reputation: 364

Umbraco - editing preview window sidebar options

I have a project which is using Umbraco v7.7.9 installed with nuget.

I was wondering if it is possible to change the buttons displayed in the sidebar section when a user selects to preview a content node. Particularly I want to remove the option that allows the user to close the preview.

The reason I want to hide this option is because some of the content the backoffice users will be previewing will not actually be published yet so clicking the close preview button causes an error.

I first asked this question on the Umbraco forums but haven't received a response yet, here is the link to the question: https://our.umbraco.org/forum/extending-umbraco-and-using-the-api/90878-editing-preview-window-sidebar-options

Thank you in advance.

Upvotes: 2

Views: 383

Answers (1)

Claus
Claus

Reputation: 1985

Currently no - it would not be possible without doing hacks in the Core that would be overwritten when you upgrade your site (unless you manually merge your changes in when updating).

If you however don't mind doing that - the file used for the preview function is /umbraco/preview/index.html. You should look for the element with an exitPreview() click handler attached to it.

In later versions (7.10+) this modification will have to be done in /umbraco/Views/Preview/Index.cshtml instead, as these static files will be changed to MVC actions.

Upvotes: 1

Related Questions