Exercise 6: Multi site
Derek C edited this page Dec 10, 2018
·
13 revisions
In this exercise, we will add an additional site to the solution to support a complex multi-site and multi-language scenario. We'll look at multi tenant, and how to leverage other features from Habitat in our tenant solution.
- In Sitecore, under
/system/Languages
- Create new language: Swedish (Sweden): Svenska (Sverige):
sv-SE
- Create new language: Swedish (Sweden): Svenska (Sverige):
- Switch to Swedish in the Language selector in Sitecore
- Move to
/Sitecore/Content/Group
- Create new Home page "Sweden" under
/Sitecore/Content/Group
- Update the fields with Swedish text (or use some Lorem Ipsum so you can identify the new version.)
- Verify that the site is visible on http://group.dev.local/sv-SE/Sweden. You should see some content coming back, but no styles as of yet.
- Create new Home page "Sweden" under
- Add Styles to your new site
- Add a Swedish version to
/Sitecore/Content/Group
- Update fields, ensuring a theme is selected.
- Verify that the site is ok on http://group.dev.local/sv-SE/Sweden
- Add a Swedish version to
- Setup Site definition and IIS binding
- Modify your hosts file to add the domain:
sweden.dev.local
- Add a new IIS binding to the habitat.dev.local site:
sweden.dev.local
- Add to
/App_Config/Include/Project/Sitecore.Demo.Group.config
in the Sitecore.Demo.Group project.- duplicate the
<site name='group'>
node - set
name="sweden"
- set
targetHostName="sweden.$(rootHostName)"
- set
startItem="/Sweden"
- set
hostName="sweden"
- set
language="sv-SE"
- duplicate the
- Add
<site>
to/App_Config/Include/Project/z.Sitecore.Demo.Group.DevSettings.config
in the Sitecore.Demo.Group project.- duplicate the
<site name='group'>
section - set
name="sweden"
- duplicate the
- Run the default gulp task to rebuild and publish your changes.
- Verify that the site is visible on http://sweden.dev.local
- Use the Site menu ( Home Icon ) to navigate between the Swedish and English site. If your English site is displaying similar to the Swedish site, make sure to clear your cookies.
- Modify your hosts file to add the domain:
- Create Swedish Dictionary texts
- Locate the
/sitecore/content/group/global/dictionary
- Add the following to
<site name='sweden'>
in/App_Config/Include/Project/z.Sitecore.Demo.Group.DevSettings.config
<patch:attribute name="dictionaryAutoCreate">true</patch:attribute>
- Publish the z.Sitecore.Demo.Group.DevSettings.config file using gulp or Visual Studio
- In a new browser window (either an incognito window, or use a different browser altogether), navigate to http://sweden.dev.local
- Switch back to your content editor browser window, and navigate to
/sitecore/content/group/global/dictionary
and see that the items are created- Navigate to the Dictionary Entries under each Dictionary Folder
- For each Dictionary Entry, add Swedish (or Unique) text to the Swedish version of the item.
- Locate the
- Setup Home Page presentation
- Copy final layout from
/Sitecore/Content/Group/Home
to/Sitecore/Content/Group/Sweden
- In Content Editor, turn on Raw Values and Standard Fields from the View tab.
- Select
/Sitecore/Content/Group/Home
, and copy the value from the Layout -> Final Renderings field. - Select the
/Sitecore/Content/Group/Sweden
item - Change the language to Swedish
- Paste value into the Layout -> Final Renderings field.
- turn off Raw Values and Standard Fields from the View tab.
- Move
/Sitecore/Content/Group/Home/_Local
toGlobal
- Add Swedish language content to the Teasers in
/Sitecore/Content/Group/Global/Teasers
- Copy final layout from
- Clone pages to Swedish site
- Clone About and Operations from
/sitecore/content/Group/Home
- Create Swedish page versions
- Change settings on
/sitecore/content/Group/Settings/Datasources/pageteaser
- Change datasources on the Operations page
- Clone About and Operations from