HXH
HXH
Apr 30, 2012
  4078
(0 votes)

EPiServer Workflow Replacement : Step 5–Bye bye, Save and Publish!

This is the fifth in a series of posts about how my company built a replacement workflow platform for EPiServer. Why we chose to do this is explained here: http://world.episerver.com/Blogs/Hans/Dates/2012/4/EPiServer-Workflow-Replacement--Step-1Explanation-and-Disabling-Edit-Tab/

I hate the Save and Publish button. This disdain essentially boils down to two issues:

  1. Humans are fallible creatures, so assuming that a page is ready to go live without actually looking at it is just asking yourself for trouble.
  2. A lot of companies use EPiServer in single instance production environments. We don’t ..but a lot do. Do you really want people to update content live on the web without looking at it?

That said, I do use Save and Publish in Development..and I get why it’s there…. I just wish there was a way to get rid of it through the application itself.

For our team, Save and Publish had to go.

  1. In CMS6, navigate to : C:\Program Files\EPiServer\CMS\6.1.379.0\Application\UI\CMS\Edit\EditPageButtonControl.ascx - if installed on 64 bit it will usually be “Program Files (x86)” instead
  2. In CMS5, navigate to C:\Program Files\EPiServer\CMS\5.2.375.7\Application\UI\Edit\EditPageButtonControl.ascx  - again, append (x86) if on a 64 bit operating system
  3. In the SaveAndPublish EPiServer UI ToolButton, change RequiredAccess to “Administer” – this prevents people with publish access from accessing the SaveAndPublish button
  4. Add RequiredAccess=”Administer” to the Publish EPiServerUI:ToolButton as well. This forces people to go to the “Workflow” tab to publish pages.

 

Here is how our CMS 6 EditPageButtonControl.ascx looks:

 

<%@ Control Language="C#" AutoEventWireup="false" CodeBehind="EditPageButtonControl.ascx.cs" Inherits="EPiServer.UI.Edit.EditPageButtonControl" %>
<asp:Panel ID="ButtonPanel" runat="server" CssClass="epitoolbararea epi-toolbarOnPage" Visible="true">
    <EPiServerUI:ToolButtonContainer runat="server">
        <EPiServerUI:ToolButton id="SaveOnly" OnClick="SaveOnly_Click" DisablePageLeaveCheck="true" SkinID="Save" text="<%$ Resources: EPiServer, button.saveonly %>" ToolTip="<%$ Resources: EPiServer, edit.editpanel.tooltipsaveonly %>" runat="server" />    
        <EPiServerUI:ToolButton id="SaveButton" OnClick="Save_Click" DisablePageLeaveCheck="true" SkinID="SaveShow" text="<%$ Resources: EPiServer, button.saveandview %>" ToolTip="<%$ Resources: EPiServer, edit.editpanel.tooltipsave %>" runat="server" />    
        <EPiServerUI:ToolButton id="SaveAndPublish" OnClick="Publish_Click" DisablePageLeaveCheck="true" SkinID="SavePublish" RequiredAccess="Administer" text="<%$ Resources: EPiServer, button.saveandpublish %>" ToolTip="<%$ Resources: EPiServer, edit.editpanel.tooltipapprove %>" runat="server" />
    </EPiServerUI:ToolButtonContainer>
    
    <EPiServerUI:ToolButtonContainer runat="server" CssClass="epitoolbuttoncontainernoborder">
        <EPiServerUI:ToolButton id="Publish" DisablePageLeaveCheck="true" OnClick="Publish_Click" SkinID="Publish" RequiredAccess="Administer" text="<%$ Resources: EPiServer, button.publish %>" ToolTip="<%$ Resources: EPiServer, button.publish %>" runat="server" />
        <EPiServerUI:ToolButton id="CheckIn" DisablePageLeaveCheck="true" OnClick="CheckIn_Click" SkinID="CheckIn" text="<%$ Resources: EPiServer, button.checkin %>" ToolTip="<%$ Resources: EPiServer, button.checkin %>" runat="server" />
    </EPiServerUI:ToolButtonContainer>
    <EPiServerUI:ToolButtonContainer runat="server" CssClass="epitoolbuttoncontainernoborder">
        <EPiServerUI:ToolButton id="Cancel" OnClick="Cancel_Click" SkinID="Cancel" DisablePageLeaveCheck="true" text="<%$ Resources: EPiServer, button.cancel %>" ToolTip="<%$ Resources: EPiServer, edit.editpanel.tooltipcancel %>" runat="server" />        
    </EPiServerUI:ToolButtonContainer>
    
    <EPiServerUI:ToolButtonContainer runat="server" CssClass="epitoolbuttoncontainernoborder epitoolbuttoncontainerright">
        <EPiServerUI:ToolButton id="StickyEdit" OnClick="StickyEdit_Click" OnClientClick="EPi.ToolTip.Hide();EPi.PreventDoubleClick(this);" SkinID="StickyEditOff" DisablePageLeaveCheck="true" text=" " RichToolTip="<%$ Resources: EPiServer, edit.editpanel.tooltipstickyedit %>" runat="server" />
        <EPiServerUI:ToolButton id="UnStickyEdit" OnClick="UnStickyEdit_Click" OnClientClick="EPi.ToolTip.Hide();EPi.PreventDoubleClick(this);" SkinID="StickyEditOn" DisablePageLeaveCheck="true" text=" " RichToolTip="<%$ Resources: EPiServer, edit.editpanel.tooltipunstickyedit %>" runat="server" />
    </EPiServerUI:ToolButtonContainer>
    
</asp:Panel>

...and now when anyone who isn’t an Administrator (basically everyone – we only grant Admin access to a very select few) goes to a page, they see the grayed out view seen below and are therefore forced to use our Workflow process.

image

 

In the next post, I will discuss how we hook the Ready to Publish action in order to send approval notifications when that button is pressed.

Apr 30, 2012

Comments

Please login to comment.
Latest blogs
Optimizely Forms: You cannot submit this form because an administrator has turned off data storage.

Do not let this error message scare you, the solution is quite simple!

Tomas Hensrud Gulla | Oct 4, 2024 | Syndicated blog

Add your own tools to the Optimizely CMS 12 admin menu

The menus in Optimizely CMS can be extended using a MenuProvider, and using the path parameter you decide what menu you want to add additional menu...

Tomas Hensrud Gulla | Oct 3, 2024 | Syndicated blog

Integrating Optimizely DAM with Your Website

This article is the second in a series about integrating Optimizely DAM with websites. It discusses how to install the necessary package and code t...

Andrew Markham | Sep 28, 2024 | Syndicated blog

Opticon 2024 - highlights

I went to Opticon in Stockholm and here are my brief highlights based on the demos, presentations and roadmaps  Optimizely CMS SaaS will start to...

Daniel Ovaska | Sep 27, 2024