Try our conversational search powered by Generative AI!
Jul 7, 2011
(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))

    RightClickMenuItem dopeItem = ContextMenu.CreateMenuItem("On-page edit", null, "EPi.ope.onEdit()", "true",
    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 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 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

Please login to comment.
Latest blogs
Developer meetups in Stockholm & Helsinki

It's time for developer meetups! Next month we will be in Stockholm and Helsinki. Join us for getting the latest updates from Optimizely, be inspir...

Magnus Kjellander | Feb 23, 2024

Roll Your Own Security Headers

Proper security headers are a must for your Optimizely driven website. There are a variety of tools out there that will help with this, but when...

Ethan Schofer | Feb 21, 2024

Migrate Catalog content properties

A colleague asked me yesterday – how do we migrate properties of catalog content. There is, unfortunately, no official way to do it. There are...

Quan Mai | Feb 20, 2024 | Syndicated blog

Adjust log levels in Optimizely DXP

You may adjust the log levels for your site in Optimizely DXP yourself, but only for the Integration environment. Follow this step-by-step guide.

Tomas Hensrud Gulla | Feb 20, 2024 | Syndicated blog