17

So I've discovered: $SPUrl:~SiteCollection $SPUrl:~Site ~language (e.g. $SPUrl:~Site/yadda/~language/yadda or whatever)

Where can I find a comprehensive listing of what's available for use with $SPUrl? And are there other prefixes like $SPUrl that can be used?

1

3 Answers 3

15

I have not seen this documented anywhere. The ones I am aware of in SharePoint 2010 (from exploration) are:

~site/ : SPContext.Current.Web.ServerRelativeUrl

~sitecollection/ : SPContext.Current.Site.ServerRelativeUrl

{ItemId} : item.ID.ToString() (or item["BdcIdentity"] if external list)

{ItemUrl} : item.Url

{SiteUrl} : web.Url

{ListId} : list.ID.ToString(“B”)

{ListUrlDir} : list.RootFolder.Url

{RecurrenceId} : item.RecurrenceID

{Source} : Request URL

The usual caveats apply: if it is not documented, there is no guarantee it will still work in the next version or service pack.

1

This maybe old, but here is the current documented URLs and Tokens https://msdn.microsoft.com/en-us/library/office/ms431831.aspx

0

I think only ~sitecollection, ~site and ~language are supported by the SPUrl expression builder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy