Tuesday, October 07, 2008

Relative URL's In a SharePoint Masterpage

I've mentioned that I hate branding, right? It is kind of nice, though, when you get it right. I've had some recent little successes that have made me happy. Or it may be the Lyrica I've been on for the past month that keeps me happy (nice drug).

OK, so while you are out there messing with masterpages, you might want to add a static URL link that goes to the current site. Here's mine that worked so nicely:

NavigateUrl="$SPUrl:~Site/../Search.aspx"
Text="Metadata Search "
Target="_new"
runat="server" CssClass="ms-SPLinkButtonInActive" Font-Size="XX-Small"/>
               
"$SPUrl:~Site/../Search.aspx" goes to a page saved at the root of the subsite. Naturally, you could specify a path into the subsite as well.

There also was a significant amount of pain that went into the meticulous placement on the masterpage. I'm not sure if I am satisfied with the way I did that. We'll see when I roll it to the QA and production environments. It is pretty! Likewise, I'm still debating on the actual location of that file, etc., but in the mean time, you've got your relative URL.

No comments:

Post a Comment