Today while helping a colleague with a SharePoint solution I remembered about URL tokens that SharePoint can use.  I swore for the life of me that I had blogged about them but apparently I didn’t.  On that note…here it is.

To get straight to the point, SharePoint has certain URL tokens that it will read from a URL and in its processing, translate into the actual values.  According to the article on How to: Add Actions to the User Interface, the following tokens exist:

Windows SharePoint Services supports the following tokens with which to start a relative URL:

~site - Web site (SPWeb) relative link.

~sitecollection - site collection (SPSite) relative link.

In addition, you can use the following tokens within a URL:

{ItemId} - Integer ID that represents the item within a list.

{ItemUrl} - URL of the item being acted upon. Only work for documents in libraries. [Not functional in Beta 2]

{ListId} - GUID that represents the list.

{SiteUrl} - URL of the Web site (SPWeb).

{RecurrenceId} - Recurrence index. This token is not supported for use in the context menus of list items.

If you search the web for “SharePoint URL Tokens” you’ll find the same copied list.  The one thing that you won’t find most likely is the following article by Stefan Gobner, Stefan Gobners URL Tokens Posting.  Stefan is a MS Support Engineer which means that he works through these weird issues on a daily basis and he blogged about a few extra URL tokens/Querystring parameters that shouldn’t be used in your URLs.  According to Stefan, the following parameter names shouldn’t be used:

  • FeatureId
  • ListTemplate
  • List
  • ID
  • VersionNo
  • ContentTypeId
  • RootFolder
  • View
  • FolderCTID
  • Mode
  • Type

Luckily none of these stumped me in the past but certainly a few times I recall naming some “random” query string parameters and knowing that these “shouldn’t” be used would have been helpful.

(03/06/2009 UPDATE) A colleague of mine just mentioned I should add:

  • k

Reason for not using k is because the search queries use that.  I am going to navigate a sharepoint site in my sparetime and look for additional ones as well because I know search uses a few more as well.

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017 Tony Testa's World