How to add/customize Edit Page option in SiteAction menu

by James 2/14/2008 6:26:00 AM

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

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

SharePoint

Comments

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen Adopted by James Tsai

About the author

Name of author James Tsai
.NET / SharePoint Consultant
Columbus, OH

E-mail me Send mail

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910
View posts in large calendar

Certifications

MCPD
MCTS

Recent comments

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Sign in