Today someone at work pointed out that there was a switch control in SharePoint that allows users to easily switch between the different languages a page is available in. I hadn't heard of this already, so if you haven't either, now you've got no more excuses to say you don't!
Now what exactly does it do? Quite easy... If variations are enabled and there's a version of a certain page available in a different language, a switch will show up to easily switch between the different versions of the page. If your page only exists in English for example, the switch control won't show up.
But most importantly... How do you enable it? Well, that's easy too. All you need to do is follow some simple steps:
- Go to the ...\12\TEMPLATE\CONTROLTEMPLATES folder and open the VariationsLabelMenu.ascx file.
- Look for the line that's commented out. Remove the comment tags to enable the control. Here's the line you should comment out:
<cms:VariationsLabelEcbMenu id ="varlabelmenu1" DataSourceID="LabelMenuDataSource" DisplayText="<%$Resources:cms,VariationLabelMenuTitle%>" IsCallbackMode="true" runat="server" />
- Now go to the Master Page you want to include the control in and make sure that it has the following tag at the top:
<%@ Register TagPrefix="PublishingVariations" TagName="VariationsLabelMenu" src="~/_controltemplates/VariationsLabelMenu.ascx" %>
If this tag is on your Master Page and you've commented out the control, then the switch control should be showing right beside the links in the upper right corner of the Master Page. Now you can use this control and put it where ever you want to. If you want, you can also use it like this:
<PublishingVariations:VariationsLabelMenu id="labelmenu1" runat="server"/>
Easy as that!