Try Now
More in this section
Blogs RSS feed

In the mean time series (part 6): "Products" module - simple implementation with enabled localization

by Ivan Osmak

Once again, I will post a ridiculously short and simple post. In this post I will demonstrate how to enable localization on products module. The idea is, of course, that we can have different versions of products depending on the culture/language end user selected.

NOTE #1: Since this post is a part of the sequential series, at the very least, you should read the introductory post and set up the project as it was explained there.

NOTE #2: Localization feature is not available in the Sitefinity Community version.

Enabling localization on products module

In order to enable localization on products module, we will have to do two things:

  • Enable localization for the site itself
  • Enable localization for the products module

To enable localization for the site, open your web.config file and navigate to the following element:


and change the persistenceMode to PathPrefix (any value other than none, will turn on the localization). While at the topic, let me segue to the list of possible values for the PersistanceMode property (NOTE: this list applies only to Sitefinity 3.5 and higher):

  • None – Localization is disabled.
  • PathPrefix - The language code is inserted as folder in the URL right after application root.
  • QueryString - The language code is appended in the query string of the request.
  • BrowserSettings - Language code is not explicitly persisted and always the first match from browser preferred languages is used. AutoSetClientLanguage property must be true when this mode is selected.
  • DomainName - The language is set per domain. This option could be used when you have different language versions and different domain for every language version. For instance the site has English and German versions, two domains could be used: myENsite.com and myGERsite.com.
  • DomainExtension - The language code comes from the top level domain, if it is a country domain (.uk, .it, .es...), otherwise the default language is used.

So, the localization element with enabled localization for site, English as default language and English and Croatian as supported languages would look like this:

<localization defaultProvider="Sitefinity" persistenceMode="PathPrefix" defaultCulture="en" cultures="en, hr"
The, second thing we need to do is to enable localization for our products module. To do so, we will need to set the allowLocalization property to true in products provider. Navigate to


element in web.config and make sure that this line has allowLocalization property set to true:
<add name="Products" allowLocalization="true" allowWorkflow="true" urlRewriteFormat="[Name].aspx" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" securityProviderName="" allowVersioning="False" applicationName="/Products" versioningProviderName="" commentsModeration="true" connectionStringName="GenericContentConnection" type="Telerik.Cms.Engine.Data.Providers.DefaultProvider, Telerik.Cms.Engine.Data" /> 
And you are done. You will be able to localize your products from now on.

The code for this sample you can download from here.

1 comment

Leave a comment
  1. Tom Janssens Jan 28, 2009
    I have a couple of problem with the module. Especially layout problems.
    The commentslink in the commandpanel is formatted wrong (I solved the highlighted link somewhat : 


    LinkButton)container.CommentsViewButton).CssClass = "sel";

    Contained  TagsViewButton instead of CommentsViewButton. However there still are some problems.

    Also the layout of the controlpanelinsert and controlpaneledit have some strange layout problems which I can't seem to find

    I am using SiteFinity 3.5 SP1

    Any suggestions?


    Leave a comment