It is doubtful that there is a Sitecore Developer who never opened /sitecore/admin/showconfig.aspx at least once in his life to check what went wrong with the amazing configuration patch that hadn`t worked. Showconfig is just one of the many admin pages that Sitecore provided by default. Other admin pages are not so popular, so I decided to talk about them in more detail.
Tag: Sitecore
Sitecore Adaptive Images – Huge Crawling Logs Problem
Some time ago I have noticed that on our production environment the Crawling Log files were abnormally big – between 500 MB and 1 GB. After some digging was found out that they were just filling up with exceptions while crawling the media library. The exceptions look like this:
WARN Could not compute value for ComputedIndexField: urllink for indexable: sitecore://master/{8EA15044-EE2C-41DB-81D6-0A9C42062814}?lang=en&ver=1
Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Sitecore.Kernel
at Sitecore.Context.PageMode.get_IsNormal()
at adaptiveImages.AdaptiveImagesMediaProvider.GetMediaUrl(MediaItem item)
at Sitecore.ContentSearch.ComputedFields.UrlLink.ComputeFieldValue(IIndexable indexable)
at Sitecore.ContentSearch.LuceneProvider.LuceneDocumentBuilder.AddComputedIndexFields()
Considering the case that there are a tons of media (over 2000 items) and languages (there is a separate exception for each language) we had some pretty serious index time performance issues and hard disk space problems.
Continue reading “Sitecore Adaptive Images – Huge Crawling Logs Problem”
Inheriting Sitecore Site Properties with Sitecore Patching and Transformation
Challenge:
Sitecore is such a huge platform that every day you find something new and interesting. Happens with you as well? It is happening with me since last 7+ years! But I am enjoying learning it and then sharing it with you.
So, let’s say you have one site node defined with all basic things e.g. enablePreview, enableWebEdit, hostName, startItem, database etc. Now you would like to have one more site where you would like to use base attributes as earlier defined and you would like to modify few attributes only:
<sites> <site name="site1" virtualFolder="/sitecore/admin" physicalFolder="/sitecore/admin" enableAnalytics="false" domain="sitecore" loginPage="/sitecore/admin/login.aspx"/> <site name="site2" inherits="site1" /> <site name="site3" inherits="site1" domain="extranet" /> <site name="site4" inherits="site1" enableAnalytics="true" /> </sites>
I tried the same approach for my project and it works well. But only locally. When I deployed it on QA server it stopped working. After deep research I have found the source of the issue. I would like to share with you as well. Let’s go!
Solution:
As you would have done, I also did showconfig.aspx on server and then noticed that my site2 was getting added before site1 and that was causing this issue and it was happening because I was using SlowCheetah Transformation and inserting site2 based on environment. To fix it — I used patch:after=”site[@name=’site1′]” which fixed this issue. Here is how it looks new with transformation:
<sites> <site name="site2" inherits="site1" patch:after="site[@name='site1']" xdt:Transform="Insert" hostName="site2.com" domain="extranet" enableAnalytics="true"/> <site name="site3" inherits="site1" domain="extranet" /> </sites>
Enjoy!
Getting Sitecore Dictionary in JavaScript
It’s very easy to get translations in back-end code — either Razor views or .cs files — by simply calling to
Sitecore.Globalization.Translate.Text()
But what about JavaScript widgets? There we have several options:
- Item Web API results in overhead and is hard to use without additional implementation.
- StringDictionary embeds values right in HTML and needs to be configured accordingly.
- Injecting translated text into .js components via HTML tags has the same drawbacks as StringDictionary.
All these options are cumbersome and inconvenient.
Continue reading “Getting Sitecore Dictionary in JavaScript”