Skip to main content


Showing posts from March, 2014

Sitecore StringUtil Class - Part 1

While playing around with the Reflector today,  I chanced about the StringUtil class inside the Kernel.
If you are working with a lot of links in Sitecore, you would have encountered the function EnsurePrefix, that takes in a char and a string as arguments; this is one of the members of this class. Aside from this uber useful utility here are a list of what you can also pick up and use inside this sealed class.

Function/MethodParametersDescriptionArrayToStringArray, charMakes strings out of ArraysCapitalizestringUppercases the first letter of a string and lowercases the remaining letters. Clipstring, int, boolClips a string at a certain length. The bool argument is for the ellipsisCombineobject, object, stringCombines the ToString() representation of the two objects separated by a string dividerConcatobject[]Accepts a collection of objects and concats the ToString() representation of each valueContainsstring, string[]Looks for the first instance of the string in the string[] object. Re…

Rich Text Editor (RTE) Stripping Script tags

Ran across an issue today wherein one of our Content Editors was complaining that their page was not working, i.e. some page scripts where not firing.
Upon closer inspection, we found out that their content inside their RTE was missing.
We added them back but, it just kept getting stripped-off when we close the editor.
This did not happen to us before when we were using SC6.5, so this basically smells more like an upgrade issue.
I scanned all of the config changes (I kept a log) and found one curious setting:

<setting name="HtmlEditor.RemoveScripts" value="true" />

This setting was by default removing any embedded scripts inside the RTE.
Just turn it off in your CM and keep it on in your CD.

Implementing a Secure Media library in Sitecore

Our internal clients wanted us to secure some of their resources stored in the media library so that only authenticated and authorized extranet users are able to view or download them. Our current setup has the following components, I'll simply focus on the 3rd and 4th points:
Sharepoint Workflows on a Sharepoint 2007 Server. This serves as the working repository of the resource owners.Sitecore Sharepoint Integration Framework. This hooks up Sitecore with the designated document library in Sharepoint for all finalized files/documentsIntegration folder in the Media libraryLogin page to handle the authenticationCreate your login page. You have the option to create your sublayout for this (mostly to control the page contents etc.) or you can just quickly create one and put it in one of your folders in your solution. I normally use CodeFile directive in my pages as we found it easier to maintain this type of setup in the long run. There are plenty of samples of the login functionality …

SC 7.0 Certified!

Yey! I just finished 4-day Sitecore 7.0 developer training in Chicago and passed the certification.
My thoughts:
Over-all good training,Good trainer.I would have hoped they had some printouts as it was pretty tedious to go Alt+Tab'ing the whole time we had to do the exercises. In 6.5 we had all these materials with us.