Don't miss out Virtual Happy Hour today (April 26).

Try our conversational search powered by Generative AI!

jacob.nielsen@valtech.dk
Jul 7, 2011
  3047
(0 votes)

On-page edit with Composer

If you are using Composer, you might have noticed that you have lost the ability to edit properties on your Composer page, since Composer seems to override or at least hide the “On-page edit” option from the context menu.

However, enabling “On-page edit” again is luckily pretty straightforward:

private void AddPageOnEditToContextMenu()
{
    if (!CurrentPage.ACL.QueryDistinctAccess(EPiServer.Security.AccessLevel.Edit))
        return;

    RightClickMenuItem dopeItem = ContextMenu.CreateMenuItem("On-page edit", null, "EPi.ope.onEdit()", "true",
                                                             "/App_Themes/Default/Images/Tools/dark/Edit.gif",
                                                             RightClickMode.View);
    dopeItem.EnabledScript = "!EPi.ope.isEditing()";
    ContextMenu.Menu.Add("DOPE item", dopeItem);
}

Call this method in the beginning of the OnInit-event on your Composer template, and you should have the ability to edit your pagetype properties directly on your page again.

Jul 07, 2011

Comments

tym.lawrence@netcat.com.au
tym.lawrence@netcat.com.au Sep 18, 2012 09:47 AM

Hi Jacob,

Thanks for this post. one question: is this a global setting or can you set it so that certain page types will have "On Page Edit", while other page types show "Composer - Edit on Page" ?

Tym

jacob.nielsen@valtech.dk
jacob.nielsen@valtech.dk Sep 18, 2012 11:01 AM

You have to add this to the OnInit event of your Composer template (.aspx), so it's not a global setting. You can however simply create a base class for your Composer templates and call the method above in the OnInit event of that.

Also, this doesn't remove the "Composer - Edit on Page" option, it simply adds a "On Page Edit" option. If you want to remove the "Composer - Edit on Page" option you're probably better off not creating a Composer template, or you can try removing the option from the ContextMenu - see http://sdk.episerver.com/library/cms6.1/html/AllMembers_T_EPiServer_Web_PageExtensions_ContextMenu.htm.

Please login to comment.
Latest blogs
Optimizely Unit Testing Using CmsContentScaffolding Package

Introduction Unit tests shouldn't be created just for business logic, but also for the content and rules defined for content creation (available...

MilosR | Apr 26, 2024

Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog