With this module you can define different dictionary folder for each Site you have or you can define shared dictionary folder cross some sites as well. it is useful when you have multi Sites installed in Sitecore content tree and you need to organize your Dictionary items in proper way to avoid conflicts. i am using Sitecore custom cache to cache the dictionary items for the context Site and context Language as well.
SXP8.2 : Compatible only with Sitecore 8.2, It will not work on earlier Sitecore versions as it is using the new Sitecore Custom cache functionality.
- Built based on Helix Principles.
- Using Sitecore search APIs.
- Using Sitecore Custom Cache.
- Define the Dictionary location path and Cache key for each Site.
- Create Cache object for the context Site and context language as well.
If you have implemented helix on your project you need only the following dlls from this module :
Note: You can use this module even if your site not build on helix but you have to : 1) Take all the dlls in the Sitecore package. 2) Make sure the website root is inherited from "Dictionary Foundation template"
Installing and Configurations
- Download the SitecoreAlphabetDictionary-1.0.zip Package from Marketplace
- Navigate to “\App_Config\Include\Foundation\Foundation.SitecoreCache.config” to change the cache site if you wantSitecore.Foundation.SitecoreCache.CacheSize : by default is 20MB
How it works :
When you install the module navigate to /sitecore/templates/Foundation/Dictionary/Dictionary Foundation template
You will find the following fields :
Dictionary Folder : you will chose what dictionary folder for your Site.
Dictionary Cache Key : this is just for caching the context site, you may have different one for each site.
For Site1 i have define my dictionary items in the global folder as below :
Make the Site root inherited from Dictionary Foundation template, and then you can choose your folder and define your cache :
Note: Code assumes these settings are exist on the root site. so the site root should be inherited from this otherwise it will not work. and you have to change line 60 in the code: siteRootItem = Context.Site.Database.GetItem(Context.Site.RootPath);
As I mentioned before it creates different cache object for the context site and context language as below:
I hope you find this post helpful, If you have any additional knowledge on this subject, comments or questions, please let me know in the comments section below.