Feb
14
2008

How to add/customize Edit Page option in SiteAction menu

If you ever want to customize OOTB "Edit Page" in SiteAction menu (give it different permission setting, description, image..etc). But still want it to work correctly when user click on it. You need to make sure the Url in <UrlAction/> is calling the right function.


<!-- Feature xml manifest.xml -->


<CustomAction Id="NewEditPageItem"

    GroupId="SiteActions"

    Location="Microsoft.SharePoint.StandardMenu"

    Sequence="1001"

    Title="Edit Page"

    Description="This is new Edit Page menu with customized settings." 

    ImageUrl="/_layouts/images/AnyImage.gif"

    Rights="AddListItems,EditListItems">

    <UrlAction Url="javascript:if(document.forms['aspnetForm']['MSOLayout_InDesignMode'] != null)document.forms['aspnetForm']['MSOLayout_InDesignMode'].value = 1;if(document.forms['aspnetForm']['MSOAuthoringConsole_FormContext'] != null)document.forms['aspnetForm']['MSOAuthoringConsole_FormContext'].value =1;if (document.forms['aspnetForm']['MSOSPWebPartManager_DisplayModeName']!= null)document.forms['aspnetForm']['MSOSPWebPartManager_DisplayModeName'].value ='Design';__doPostBack('ctl00$PlaceHolderTopNavBar$ SiteActionsMenuMain$ctl00$wsaEditPage_CmsActionControl','switchToAuthoring')"/>

  </CustomAction>

I have read other posts and they are saying it should look like


<UrlAction Url="javascript:MSOLayout_ChangeLayoutMode(false);"/>

That is incorrect. Because what it does is to change display mode and page view of the web part page

blog comments powered by Disqus