Mari Jørgensen
May 19, 2010
(0 votes)

Smooth Publish Using JQuery and EPiServer Quick Publishing

One of the new features in EPiServer CMS 6 is Quick Publishing (previously called Content Guides). This is a great way of letting users create and publish content without touching edit mode. To read more about Quick Publishing, see the ‘Let Those Users in’ section in this article.

I wanted to take this one step further, I wanted certain users to be able to create and edit pages directly from view mode (i.e. “hide” edit mode from the user). At the same time I wanted to avoid coding a custom “create view”, but instead use built in EPiServer edit templates.

Using the JQuery ColorBox Plugin together with Quick Publishing gave me a the result I was looking for (I’ll explain in detail how it works below).

How does it work?
First you need to configure the page guides:

  <pageGuide destinationPageId="394"
       pageTypeName="[Demo] Blog personal start"
       title="Edit Personal Blog">
      <pageProperty propertyName="PageName" />
      <pageProperty propertyName="Details" />
      <pageProperty propertyName="Writer" />
      <pageProperty propertyName="Image" />
      <pageProperty propertyName="ListCount" />
  <pageGuide destinationPageId="394"
        pageTypeName="[Demo] Blog item"
        title="Create Blog">
      <pageProperty propertyName="PageName" />
      <pageProperty propertyName="MainBody" />
      <pageProperty propertyName="Tags" />

For more information on Quick Publishing configuration visit this document.

I added two links at the top of the Personal Blog Start Page Template (only visible on the user’s own blog start page) – one for editing the current page and one for creating a new Blog post.


<asp:PlaceHolder runat="server" ID="plhEditAndCreate">
   <div id="EditCreatePanel">
     <a href="<%= EditUrl %>" class="popupCustom edit" title="Edit your settings">
        Edit my settings</a> &nbsp; 
     <a href="<%= NewBlogUrl %>" class="popupCustom create" title="Write Blog Post">
        Write Blog</a>

Where the “NewBlogUrl” property would return

        Settings.Instance.SiteUrl, Settings.Instance.UIUrl.ToString().Replace("~/", string.Empty),
            CurrentPage.PageLink.ID, CurrentPage.LanguageBranch, CurrentPage.LinkURL);

A quick explanation of the query parameters:

parent: the parent page of the new page,
mode: set to ‘pageguide’,
guideName: set to the name of the guide (from config above),
pageGuideStartUrl: the url to load when guide is finished (user publish page or presses ‘Cancel’).

(The “EditUrl” is very similar, except for the id parameter replacing the parent parameter).

Next step is to active the light box functionality on these links:

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ScriptContainer">
    <script type="text/javascript" src="<%= ResolveUrlFromUI("JavaScript/edit.js")%>"></script>
    <script type="text/javascript" src="<%= Page.ResolveClientUrl("~/Templates/Demo/Scripts/colorbox/jquery.colorbox-min.js") %>"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            //Examples of how to assign the ColorBox event to elements
            $(".popupCustom").colorbox({ width: "50%", height: "80%", iframe: true });

See to learn about different colorbox options, view example code and download necessary files.

Hiding the right click menu

As I mentioned in the start of this post, I wanted to “hide” edit mode for a certain group of users, i.e. I wanted to remove the right click menu. I solved this by creating a custom base template class (which all templates inherits from), and adding the following code to the template’s OnInit() method:

if (PrincipalInfo.CurrentPrincipal.IsInRole("External"))
    ContextMenu.Menu = null; 

Important notes

  1. Notice the reference to EPiServer’s Edit.js in the JavaScript section above.  Because of the use of in EPiServer’s ClientScript SetupEvents() method, you will get a JavaScript error if you fail to add it. Thanks to Henrik Tengelin for solving that issue!
  2. In addition to the JavaScript files referenced above, you also need to add a reference to JQuery (I used version 1.3.2 of JQuery in this project) and the ColorBox css file.
  3. Remember to give the necessary access to users in question– since where using EditPanel.aspx inside EPiServer UI, they need access to edit mode (location setting in web.config). And off course, they need necessary access to the EPiServer page tree as well.

Thanks to Stein-Viggo Grenersen for creating the video!

May 19, 2010


Sep 21, 2010 10:33 AM

Nice one Mari

Sep 21, 2010 10:33 AM

Very cool. Bookmarked :-)
/ Jarle Friestad

Mathias Nohall
Mathias Nohall Jul 20, 2011 11:11 AM

How do I ad the correct user rights for the editpanel?
I have entered this location input to my webconfig:

But I still need to login to episerver CMS (as an administrator) to be able to enter the quickeditmode.

Mari Jørgensen
Mari Jørgensen Jul 25, 2011 01:58 PM

EditPanel resides inside the edit folder, here is a sample location tag:

Also, remember to give the myUsers group publish access in the edit tree.

Christer Pettersson
Christer Pettersson Nov 7, 2011 03:00 PM

Is there a way to set another returnUrl efter you Save/Publish the page, for instance if you would like to return to a searchResult?

Mari Jørgensen
Mari Jørgensen Nov 9, 2011 08:20 AM

I guess you could check on PostBack and newly published inside the OnLoad method?

Please login to comment.
Latest blogs
IDX21323 - RequireNonce is true, Nonce was null

We have multiple clients configured with Azure Active Directory (Microsoft Entra) for requiring authentication when accessing their website. The...

David Drouin-Prince | Oct 1, 2023 | Syndicated blog

Minimum Detectable Effect in Optimizely Web Experimentation

Understanding Minimum Detectable Effect Minimum Detectable Effect (MDE) is a core statistical calculation in Optimizely Web Experimentation. In...

Matthew Dunn | Oct 1, 2023 | Syndicated blog

Configured Commerce - Introduction to Long-Term Support (LTS) Releases

First off, for those who have not had a chance to meet me yet, my name is John McCarroll, and I am the Technical Product Manager for the Optimizely...

John McCarroll | Sep 29, 2023

Auto-translate with OpenAI in Optimizely CMS

You can now auto-translate content using your favorite online AI service, inside the old trustworthy Episerver.Labs.LanguageManager!

Tomas Hensrud Gulla | Sep 29, 2023 | Syndicated blog