Tuesday, March 14, 2017

Sitecore-Dictionary best practices



Dictionary best practices
Architecture and customization
Jitendra Soni

1      Introduction

For multilingual site, dictionary is an important aspect for all supporting text and it’ very important that it should be well defined – location, internal structure, based on last some international project, Here I am sharing some details for the reference.

1.1      Purpose of document


Provide the input to implement dictionary object, will cover below points.
1.      Location to define dictionary objects.
2.      Recommendation for the internal structure
3.      Support and structure for multisite
4.      Use of multiple dictionaries
5.      A quick practical and walkthrough.

2      Location to define dictionary objects

It should be defined in the shared content for the site, in case of multisite, multiple dictionary will be very useful.

2.1           Global and Site specific Dictionary location and pattern.

 

2.1           Default dictionary location and use cases.

Default dictionary can be used for system key word or in case if there is only one site.

3      Recommendation for the internal structure

There are two ways to define the internal structure, below are the details.

4      A quick practical demo






5      Sample code:-

<div id="page">
    <div id="logo">
        <h1><a href="/" id="logoLink">Sitecore</a></h1>
    </div>
    <div id="nav">
        <ul>
            <li><a>Home</a></li>
            <li><a>About</a></li>
            <li><a>Contact</a></li>
        </ul>
    </div>
    <div id="content">
        <h2>HoFe</h2>
        <p>
            Feature 1 - Best way to use the Dictionary objects
        </p>
    </div>
    <div id="footer">
        <p>
            <h3>Sitecore.Globalization.Translate.Text("aauthor")</h3>
            Webpage made by Default Dictionary - <a href="http://jitendrasoni.blogspot.com" target="_blank">"@Sitecore.Globalization.Translate.Text("aauthor");"</a>
            <br /> <br />
            <h3>Sitecore.Globalization.Translate.TextByDomain("GlobalSite", "aauthor")</h3>
            <br />
            Webpage made by GlobalSite Dictionary - <a href="http://jitendrasoni.blogspot.com" target="_blank">"@Sitecore.Globalization.Translate.TextByDomain("GlobalSite", "aauthor");"</a>
            <br /><br />
            <h3>Sitecore.Globalization.Translate.TextByDomain("MainSite", "aauthor")</h3>
            <br />
            Webpage made by MainSite Dictionary - <a href="http://jitendrasoni.blogspot.com" target="_blank">"@Sitecore.Globalization.Translate.TextByDomain("MainSite", "aauthor");"</a>
            <br /><br />
            <br /><br />
            <h2>Duplicate items</h2>
            <h3>Sitecore.Globalization.Translate.Text("aauthor")</h3>
            <br />
            Webpage made by Default Dictionary - <a href="http://jitendrasoni.blogspot.com" target="_blank">"@Sitecore.Globalization.Translate.Text("aauthor");"</a>
            <br /><br />
        </p>
    </div>
</div>






6      Question-Answer-Suggestions

Please do share input on below email id – Will get back to you soon and update the document if required with reference to suggestion/inputs.
JITUSONIJK@HOTMAIL.COM

No comments:

Post a Comment