Written by: Dustin Schieler 7/10/2012 3:07 PM
I came across a seemingly simple to find token issue and low and behold, could not find the answer so easily. I wanted to render the URL path into the HTML of my Masterpage. It took me quite a while to find the answer so I thought I would add it to my blog to make it a little easier for others to find. It is actually quite simple; you utilize the SPUrl token from SharePoint. Here it is used in a hyperlink:
<a href="<% $SPUrl:~site/_layouts/Authenticate.aspx %>" runat="server">Sign In</a>
This is a simple login link that if clicked on, an authenticated user will be logged into the sub-site of whatever page they were just on.
You can use this token in may other ways, of course!
You can add any further path you need after ~site/ The critical part is to remember to use the runat="server" in the tag or it won't work.
0 comment(s) so far...
Designed by Dustin Schieler Google+