Try our conversational search powered by Generative AI!

jacob.nielsen@valtech.dk
Jul 7, 2011
  3045
(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 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

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog

The A/A Test: What You Need to Know

Sure, we all know what an A/B test can do. But what is an A/A test? How is it different? With an A/B test, we know that we can take a webpage (our...

Lindsey Rogers | Apr 15, 2024

.Net Core Timezone ID's Windows vs Linux

Hey all, First post here and I would like to talk about Timezone ID's and How Windows and Linux systems use different IDs. We currently run a .NET...

sheider | Apr 15, 2024