Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Jump straight into edit mode on PublishingPage

$
0
0
Hey all,

I'm using MOSS 2007. I've been trying to find a way to link straight to a Publishing Page in editing mode, e.g. sending people an e-mail with a link asking them to edit the page. Sharepoint does not appear to have an option for this, so I figured I'd create a small control that would check the querystring for a parameter (editmode=true), it would switch into edit mode.
So I create a control that OnInit does the following:

Microsoft.SharePoint.SPContext ctx = Microsoft.SharePoint.SPContext.Current;  
ctx.FormContext.SetFormMode(Microsoft.SharePoint.WebControls.SPControlMode.Edit, true); 

I also do some checks to make sure the file is checked out, and if not, gets checked out.
The problem with this solution: Microsoft.SharePoint.Publishing.WebControls.EditmodePanels turn out to read the FormMode before I ever get the chance to set it. EditmodePanels are used extensively in my page layouts so this is a real problem.
Does anyone know how to get this working the way I need it to? Is there maybe a simpler way to achieve an edit link?

Thanks,

Menno

Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>