Friday 30 June 2017

GetItem method returns null when Item Name is like GUID

Recently, we upgraded our CMS to Sitecore XP 8.2 Initial Release, we started facing weird issue. The fonts where not loading on pages. When we started digging the issue, we found a pattern. The issue was not for all font files but only for those having GUID like names

E.g. 054c9659-429a-4553-b54e-7db2eedb542a.woff2

So, we tried to reproduce and debug the same in local and we came to know that while trying to get item by using GetItem(string path) method, it returns null.

Then we tried to replicate the same in clean sitecore installation. We created an Item under /sitecore/content/Home/ and named it 054c9659-429a-4553-b54e-7db2eedb542a

Thursday 22 June 2017

Sitecore Cache Manager Tool


Sitecore provides very powerful caching mechanism. Mainly there are three types of cache layers, Items cache, Data cache and Prefetch cache.

Other than above caches, there are many other different caches sitecore maintains in memory. And the number dramatically increases if you have multisite instances.

Read more about sitecore caches in detail: http://sitecoreblog.patelyogesh.in/2013/06/how-sitecore-caching-work.html

Caching issues on CD servers after publishing is common when you are dealing with horizontally scaled Sitecore environment and we were no exception. Recently, we started facing this issue frequently.

Meanwhile you are troubleshooting the caching issue as it might not be a task of a day or two - sometimes you may have to wait for weeks for it to reproduce and collect all relevant data - Cache Manager tool is must have tool for all Sitecore developers dealing with large instances.

Sitecore provides a nice caching tool, Cache.aspx,  in built. (you may find it at /sitecore/admin/cache.aspx) this tool is helpful when you are dealing with small instances of sitecore where your entire cache size is not more than 500 MB, because this tool has a button to clear ALL the caches on a single hit.

Sunday 11 June 2017

Sitecore: Add Custom Standard Values Tokens


Sitecore provides below seven out-of-the-box standard values tokens

    $name: The name for the new item entered by the user
    $id: The ID of the new item
    $parentid: The ID of the parent of the new item
    $parentname: The name of the parent of the new item
    $date: The system date in yyyyMMdd format
    $time: The system time in HHmmss format
    $now: The system date and time in yyyyMMddTHHmmss format

Although in most cases you may fulfill your requirements using above tokens, but sometimes, you may need to create additional tokens.

For example, showing user full name who created the item.

This can simply be done by extending Sitecore's master variable replacer class,  Sitecore.Data.MasterVariablesReplacer

Tuesday 23 May 2017

Sitecore Integrated Icon Finder Module


If you are working on Sitecore then you must be aware that setting a proper contextual icon for a content item is usually a good practice as it helps content authors as well as developers to easily identify the context of an item or the purpose the page is created for.

Sitecore provides a rich set of icons in built. There are around a thousand icons we can search from, to select a contextual icon for an item. But there is no search feature available out of the box, so selecting a right icon seems very tedious process sometimes.