Creating Site Variations and Variations Label Menu not working

Tagged with: ,
Monday, January 7, 2008, 6:39
This news item was posted in ECM, Web Content Management category and has 1 Comment so far.

MSDN has a great article on how to create site variations.   The article walks you through creation of Variation Labels and then viewing the site with the Variations Label Menu.   To enable the site variations label follow these instructions as Microsoft forgot to include in the article:

  1. Open your master page either within SharePoint Designer, Visual Studio, Notepad, etc.
  2. Add a Register TagPrefix to the page (if it isn’t already present)
    <%@ Register TagPrefix=”PublishingVariations” TagName=”VariationsLabelMenu” src=”~/_controltemplates/VariationsLabelMenu.ascx” %>
  3. Place the Variation Menu Label (where you would like it to show up) between the <Form></Form> as follows:
    <PublishingVariations:VariationsLabelMenu id=”labelmenu1″ runat=”server”/>
  4. Check In & Publish the Master page
  5. On your sharepoint server(s) open the ‘VariationsLabelMenu.ascx’ file in notepad - file location: %DRIVE%\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES\
  6. You will see that the cms:VariationsLabelIEcbMenu is outcommented with <%– –%> comments. Remove these comment tags and save the file.
  7. Your VariationsLabelMenu works fine now!

Now if for some reason that variation label does not seem to work then you can use my solution which is very simple.  I wanted to provide a client based solution to the Variations Label Menu as a colleague was not able to get it working and was under a time constraint.  Here is my javascript code that will take the current URL, replace the variation label and and change the language:

// Grab the current URL and store it
var str = new String(location.href);

//  Look for en-ca within the URL and replace it with fr-ca
if (str.indexOf(”en-CA”) >= 0 || str.indexOf(”EN-CA”) >= 0 || str.indexOf(”en-ca”) >= 0 ) {
var newStr = str.replace(/en-ca/i, “fr-ca”);
document.write(’<A href=”‘ + newStr + ‘”>FRAN&Ccedil;AIS</A>’);
}

//  Look for fr-ca within the URL and replace it with en-ca
if (str.indexOf(”fr-CA”) >= 0 || str.indexOf(”FR-CA”) >= 0 || str.indexOf(”fr-ca”) >= 0 ) {
var newStr = str.replace(/fr-ca/i, “en-ca”);
document.write(’<A href=”‘ + newStr + ‘”>ENGLISH</A>’);
}

Related Posts:

  • How To Create And Implement Multilingual Environments (aka Language Variations) In SharePoint 2007
  • Publishing sites can be tailored for different cultures, markets, and languages. Variation settings enable site owners to create and maintain a number of different versions,
  • Download SharePoint Server 2007 Language Pack (ServerLanguagePack.img - 104MB)
  • Microsoft has released SharePoint Server 2007 Language Pack providing you with an 104MB IMG file for download. The SharePoint 2007 Language packs enable creation
  • Top SharePoint Posts Last Week (02.18.07 - 02.24.07)
  • Another successful and another post on top posts. If you haven't already, subscribe to SharePoint Buzz's RSS Feed which has passed the 200 Feed
  • Download SharePoint Server 2007 Language Pack (x64) Direct from Microsoft (ServerLanguagePack.img 104MB)
  • Language packs enable creation of SharePoint sites and site collections in multiple languages without requiring separate installations of SharePoint Server 2007.  Multiple language packs can
  • Sorting Out Site Collections in Sharepoint 2007
  • Amanda has a written an article on Sorting Out Site Collections in Sharepoint 2007. There seems to be some confusion on the difference between site collections
    Both comments and pings are currently closed.

    One Response to “Creating Site Variations and Variations Label Menu not working”

    1. bdimitre said on Thursday, October 16, 2008, 10:48

      I have been working with variations on MOSS 2007 and I must say I am not too happy with them thus far.
      My problem currently is this and I am hoping someone can help me.
      I have a site called “SiteA” and I need to create 10+ variations of it for different countries.
      When I create the variation all relative links with in the content stay the same. For example

      http://www.mysite.com/SiteA/ is my variations source site with Variation label SiteA

      and I create a variations with variation label name SiteB so I would have http://www.mysite.com/SiteB/

      All the links with in the content of SiteA would be like: http://www.mysite.com/SiteA/Products/Pages/product.aspx
      So in the variation SiteB all URL links should have been updated from SiteA to SiteB…

      I was under the impression that variations would automatically update all relative links and URL’s within the site. Is that true?

      If not is there an easy way in SharePoint Designer 2007 to use something like Find and Replace for the entire site instead of having to go in to each page and do it manually?

      Any help and response would be greatly appreciated.

      Thank you.