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

Add comment


 

  Country flag

biuquote
  • Comment
  • Preview
Loading



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 and SharePoint consultant

E-mail me Send mail

Calendar

<<  January 2009  >>
MoTuWeThFrSaSu
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678
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 2009

Sign in