How to specify a link relative to the root of a variation label

The Web designers on my WCM project need a way to specify a url relative to the root of the variation label they are currently in. For example, if we have a site map page for english, and another one for german and they want to create a link in the page layout (shared by both english and german), how would they do that?

In code, I can obviously determine the right path, but I'm having trouble figuring out a way to do this so it's easy for them to specify the correct link in plain HTML.

Any thoughts?

-Jay

[543 byte] By [shadesofjay] at [2008-3-6]
# 1

I'm curious how this would work as well. I've created an image library and I have to do:

<img class="logo" src="/sites/MySiteNameHere/PublishingImages/Header/logo.gif" width="227" height="74"/>

which would seem not to scale and probably wouldn't work when I try to publish. If you find the answer, please post here!

ChrisCoddington at 2007-9-13 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Enterprise Content Management...
# 2

Hi Chris,

Try

<img class="logo" src="~/PublishingImages/Header/logo.gif" width="227" height="74" runat="server"/>

I guess this should solve your problem as the same would automatically scale to the respective site no matter the source site or variation....

MayurJoshi at 2007-9-13 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Enterprise Content Management...
# 3

Unfortunately it generates the following:

<img class="logo" src="http://HostName/PublishingImages/Header/logo.gif" width="227" height="74" runat="server"/>

when I need:

<img class="logo" src="http://HostName/sites/MySiteNameHere/PublishingImages/Header/logo.gif" width="227" height="74" runat="server"/>

I ended up doing this:

<img class="logo" src="http://PublishingImages/Header/logo.gif" width="227" height="74" runat="server"/>
ChrisCoddington at 2007-9-13 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Enterprise Content Management...
# 4

Hi Chris,

Try this

<img class="logo" src="~site/PublishingImages/Header/logo.gif" width="227" height="74" runat="server"/>

I guess this should work out...

MayurJoshi at 2007-9-13 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Enterprise Content Management...
# 5

Well, if anyone is curious, the way we solved my problem was to use a custom resource file containing a different url for each variation. The ASP.Net localization api automatically retrieves the correct string for the current variation (because you set the culture used for each variation) which we use to set the NavigationUrl property of a hyperlink control.

-Jay

shadesofjay at 2007-9-13 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Enterprise Content Management...

SharePoint Products and Technologies

Site Classified