Geeks With Blogs
Andy Johns' Blog Andy's twisted brain....

Along the same theme as my last post....

A lot of people don't realize just how easy it is to create their own “Modify Page” link/button/whatever.... All you really need is something that can have an onClick event.... For example, here's a “Modify Page” button, drop this into a Content Editor web part, strip off the web part frame and you're done...

<input id="btnModifyPage" type="button" class="UserButton" onClick="javascript:MSOWebPartPage_OpenMenu(MSOMenu_SettingsMenu, this);" value="Modify Page" />

So simple, so easy, right? Now because this isn't the actually WebPartPages:SettingsLink web part it will not change text from “Modify Shared Page” and “Modify My Page” depending on the page view you're on.... For most users I don't find that a problem anyway, thus the button text here is “Modify Page” Nice and generic. The functionality is the same however, if a use has access to modify both a personal page and a shared page they can do both from this button..... The javascript command is the same in either case.

-A

Posted on Monday, March 1, 2004 7:03 AM | Back to top


Comments on this post: Sharepoint Modify Page Button

# re: Sharepoint Modify Page Button
Requesting Gravatar...
I tryed to do what you sayed, but I counter a javascript error:

I hadded the same code of your example on a webpart page> It works fine, the menu appears.

But when removing the the actually WebPartPages:SettingsLink webpart, the link throws a javascript error.

Don't you have the same purpose ?

Benji
Left by Benji on Jun 11, 2004 3:56 AM

# re: Sharepoint Modify Page Button
Requesting Gravatar...
Well, as with any debugging exercise, it depends on your specific setup, and the specific error you're getting.... In your case, you might want to try the quick-workaround of keeping WebPartPages:SettingsLink on your page, as the new link appears to still function then, just set the web part to be invisible....
The true solution will be tracking down the javascript error and determining what's going wrong there....
Good luck...
-Andy
Left by Andy on Jun 11, 2004 6:42 AM

# re: Sharepoint Modify Page Button
Requesting Gravatar...
Hi Andy,

You've got - I think - the only info. on this I actually posted to another one of your postings on a similar topic. I seem to be getting a couple of errors. The first is that when I add my content editor web part, the page errors stating children not allowed. Dies the editor need to be wrapped with something else? Then, I decided to include the SettingsLink because I thought I needed it. Well, my Modify Page comes up, but I now get a javascript error for MSOMenu_SettingsMenu. Can you advise where I pull that into my page template?

Thanks Much,

- NJC
Left by NJC on Jun 13, 2004 9:30 AM

# re: Sharepoint Modify Page Button
Requesting Gravatar...
Andy, you are now officially my hero!

Thanks for this one,
Jason
Left by Jason Firth on Sep 02, 2004 5:56 AM

# re: Sharepoint Modify Page Button
Requesting Gravatar...
You might like this one.

In IE, Favo[u]rites - Organize Favourties - Right Click 'Links' - select open. Opens a new explorer window in the links folder.

Right click, new shortcut, put anything in the destination (it's temporary), call it 'customise page'.

Right click the shortcut, properties. In the shortcut, add this:

javascript:MSOTlPn_ShowToolPane('2');


Now, on ANY (WSS) page, you can get to the customize page - without requiring a link on the page itself.


There's also:

javascript:MSOLayout_ToggleLayoutMode()


Left by Marc Free on Nov 12, 2004 10:18 AM

# re: Sharepoint Modify Page Button
Requesting Gravatar...
Hello Andy,
I find that I'm having the same problem that Benji & NJC are having.

As soon as I remove the original "Out of the Box" 'Modify Page' webpart, I recieve a javascript error "MSOMenu_SettingsMenu".

How were you able to avoid this error?

-- Martin
Left by Martin on Nov 22, 2004 7:27 AM

# re: Sharepoint Modify Page Button
Requesting Gravatar...
hi Andi
I Can programmically change menuItem In
Modify shared page Button as : Add web Parts ,...
Please Help me
Left by iZA Soufi on Apr 19, 2005 5:12 AM

# re: Sharepoint Modify Page Button
Requesting Gravatar...
Hi Andi,
I have similar kind of requirement, can we add more options to modify Shared page menu
Thankx
Left by Sumi on Jul 18, 2005 12:14 AM

# re: Sharepoint Modify Page Button
Requesting Gravatar...
Hi I have aproblem with customize it for example I want to change this menuItem language.
For the webpart I can do it but for modify menu I have no idea to do it...
plz help me
Left by sia on Aug 23, 2005 4:52 PM

# re: Sharepoint Modify Page Button
Requesting Gravatar...
warning - i'm using FP2003, and am a SUPER NOVICE at both FP & SP - so sorry for the lame question :)
i'm trying to create a .dwt for a team site. when i save my default.aspx as a .dwt i'm getting messages re the SettingsLink and AuthenticationButton - "class does not derive from the Microsoft.SharePoint.WebPartPages.WebPart class and therefore cannot be imported or used in a WebPartZone control.
don't know if this is related, but i've checked my Web Part Gallery and don't see SettingsLink or AuthenticationButton.
can you offer any help/guidance?
thnx much!
Left by kd on Oct 09, 2005 4:38 AM

# re: Sharepoint Modify Page Button
Requesting Gravatar...
If javascripting is not the way you intend to go ... here is another way same result can be achieved

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using Microsoft.SharePoint.WebPartPages;
using Microsoft.SharePoint;
using System.Xml.Serialization;

namespace SettingsLinkExample
{
[XmlRoot(Namespace="SettingsLinkExample")]
[ToolboxData("<{0}:WPRenderSettingsLink runat=server></{0}:WPRenderSettingsLink>")]

public class WPRenderSettingsLink : Microsoft.SharePoint.WebPartPages.WebPart
{
private Microsoft.SharePoint.WebPartPages.SettingsLink mylink1;
private Microsoft.SharePoint.WebPartPages.SettingsLink mylink2;
private Microsoft.SharePoint.WebPartPages.SettingsLink mylink3;
private Microsoft.SharePoint.WebPartPages.SettingsLink mylink4;

public WPRenderSettingsLink()
{
}

protected override void CreateChildControls()
{
LiteralControl text;
text = new LiteralControl("<br>No Text specified:<br>");
this.Controls.Add(text);
mylink1 = new Microsoft.SharePoint.WebPartPages.SettingsLink();
this.Controls.Add(mylink1);
text = new LiteralControl("<br>");
this.Controls.Add(text);
text = new LiteralControl("<hr><br>Text specified and font:<br><FONT face=Verdana size=6>");
this.Controls.Add(text);
mylink2 = new Microsoft.SharePoint.WebPartPages.SettingsLink("LinkText");
this.Controls.Add(mylink2);
text = new LiteralControl("</font><br>");
this.Controls.Add(text);

text = new LiteralControl("<hr><br>Text specified no font:<br>");
this.Controls.Add(text);
mylink3 = new Microsoft.SharePoint.WebPartPages.SettingsLink("LinkText");
this.Controls.Add(mylink3);
text = new LiteralControl("<br>");
this.Controls.Add(text);

text = new LiteralControl("<hr><br>Text specified splink added:<br><table><tr><td align=\"right\" valign=\"bottom\" class=\"ms-SPLink\" style=\"padding:5px\">");
this.Controls.Add(text);
mylink4 = new Microsoft.SharePoint.WebPartPages.SettingsLink("LinkText");
this.Controls.Add(mylink4);
text = new LiteralControl("</td></tr></table>");
this.Controls.Add(text);
}

// Render the WebPart
protected override void RenderWebPart(HtmlTextWriter output)
{
this.EnsureChildControls();
this.RenderChildren(output);
}
}
}
Left by ABsoft on Feb 17, 2006 3:26 AM

# re: Sharepoint Modify Page Button
Requesting Gravatar...
I also have the same problem with a team site within my SPS 2003 environment. The modify shared page link is on the page but does not drop-down or allow any type of modifications to the page. The modify link does nothing currently. Any assistance is greatly appreciated. Thanks -Tammy
Left by tammy on Aug 04, 2008 6:37 AM

# re: Sharepoint Modify Page Button
Requesting Gravatar...
Hi,

I'm very new in SharePoint 2007 and just started learning on it.

I wish to create 'Modify My Page' link. Can anyone tell me in steps for doing it because i don't know where to start as from Andy posted?

Please help.

Thanks & Regards,
Iris
Left by Iris on Dec 17, 2008 11:00 PM

# re: Sharepoint Modify Page Button
Requesting Gravatar...
Hi...I'm having a similar but unique problem related to the Modify Shared Page link. After switching to Edit mode in my newly created Portal, the Modify Shared Page link doesn't work...it does nothing, no drop-down of choices to add a Web part or design the page, etc. Nada. Have you seen this problem before? Do you know how to resolve it? Thanks. --Ravi
Left by Ravishanker on May 16, 2009 1:37 AM

Your comment:
 (will show your gravatar)


Copyright © Andy Johns | Powered by: GeeksWithBlogs.net