Jeroen Derde's Blog

My Software Engineering Universe

Add the source parameter to SharePoint links

clock October 5, 2011 20:46 by author Jeroen Derde

Let say we have a publishing page, and we create a link on that publishing page to the NewForm of a List.
Aftre the user created the listitem we would like to go back to the page the user clicked the link, in stead of the list overview page.
When you want to return to the page you came from, sharepoint uses a QueryString Parameter called "source".
Microsoft was even kind enough to provide us with al small javascript function to automatically add this parameter to a Link.
In a content editor webpart u can use
<A onclick="GoToLink(this);return false;" href="/feedback/_layouts/listform.aspx?PageType=8&ListId={B0EF9608-FC48-401E-9343-4EDDF4585131}&RootFolder=">new feedback</A>
--update--
If however you are in a Publishing page Content Field, SharePoint is kind enough to strip all javascript from the contents.
So you will have to manually add the source parameter for that link.
GoToLink is located in the core.js
 
 


PublishingWebControls:EditModePanel

clock October 1, 2011 02:56 by author Jeroen Derde

Found out today that the behaviour of the PublishingWebControls:EditModePanel changed between MOSS2007 and SP2010.

Apparently,now in SP2010, you need the EditItem Permission to be able to see what is in an EditModePanel even if the PageDisplayMode attribute is set to "Display".

So basically it works like a SPSecurityTrimmedControl

Example:

<SharePoint:SPSecurityTrimmedControl PermissionsString="EditListItems" runat="server"> 
</SharePoint:SPSecurityTrimmedControl>

Update
This behaviour has been changed back to 2007 behaviour as of SP1 for Sharepoint 2010




Month List

Calendar

<<  December 2017  >>
MoTuWeThFrSaSu
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

View posts in large calendar

Sign in