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.
Comments