Multisite and Mulitlingual
Multilingual
Step 1 : To get started, we first need to install the required language. Log into Sitecore and go to the control panel. Under Localization, click Add a new language.
Step 2 : From the dropdown, choose the language you want to add. Notice there are multiple options for Spanish. You can create content based on the language and the region.
Step 3 : The dialog is populated with the language and the region code. These codes will be used by Sitecore when creating links to other language versions of content (ie. /es-ES/about). We do not want the region code, so clear out that box. When Sitecore creates links to our Spanish content, the links will only have the language (ie. /es/about).
Step 4 : In the content editor you will notice that the UI is updated to allow creation and publication of content in Spanish. By default all content authors can create and publish in all installed languages.
You can view you site’s content in Spanish by adding /es/ between the domain name and the page path (ie domain.com/es/about-us) or by adding ?sc_lang=es at the end of the page path (ie domain.com/about-us?sc_lang=es). Once Sitecore sees either of these language identifiers, it stores the language in a cookie. If no language identifier is found in the url, it will use the value in the cookie. The user will browse the site in the last identified language until another language identifier is specified.
Step 5 : This first time you publish content in Spanish and view the page, you will likely get the yellow error screen. Sitecore attempts to get the Spanish version for every content item on the page (header, nav items, subnavs, content, footer, footer links, etc). If there is no Spanish version of a given piece of content, it returns a null object to the view causing this error.
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<sites>
<site name="website">
<patch:attribute name="enableItemLanguageFallback">true</patch:attribute>
</site>
</sites>
</sitecore>
</configuration>
Multisite
Consider a new site whose name will be 'local.sitecore92.com'. Configuring this site to Sitecore requires the following steps:
- Step1: Select an existing item in the content tree (or create one from scratch).
- Step2: Add your site name to Sitecore Instance and it can be done in the following two ways:
Add the <site> element under the <sites> section of the sitecore.config file.
Or
Add the <site> element under the <sites> section of the SiteDefintion.config file.
Adding a new site to the config file is only the first step. To access the newly added site, there are two other steps that need to be completed outside of Sitecore.
- Step3: Add the site name to the IIS binding.









Comments
Post a Comment