Wednesday, December 10, 2014

Convincing IT to adopt MongoDb

Jason Carter of Nonlinear Creations and I had an interesting conversation at the Toronto Sitecore User Group about a commonly asked question by IT implementing Sitecore 7.5 and xDB.  Through some quick brainstorming we worked through some of the answers. Below is the results of our discussion.

Issues Raised:
  1. Issue: As a .NET shop, our IT staff do not have the know-how to secure, maintain and support this new technology what are our options?

    • Sitecore offers xDB in the cloud.  This hides the MongoDb implementation from you.  They handle licensing, its easy to set up with their wizard and you just pay a subscription.
    • Think about your PVR.  It probably runs linux or some other open source OS but you dont have to worry how it works you plug it in and it saves your shows and you can access them through an API or in most cases a cable that connects to your tv.
  2. Issue: As an open source product, is MongoDb secure?  Look what happened with OpenSSL.

    •  MongoDb is storing analytics collection information.  It is NOT storing creditcards or raw transations.  You are probably already using Google Analytics or other web based analytics.and MongoDb is just as secure.  Any collaborative metrics from CRM or financial transations are summarized in the SQL Server database NOT MongoDb which is only for collection.
    • jQuery/javascript is an open source technology that you use for front end.
    • Html is open source.

If you have other issues with or without reasoning let us know and we can see if we can help.

Thanks Jason for the awesome discussion, we hope to see more of these from you in the future.

If you have any tips, tricks or resources please email them to

Sunday, December 7, 2014

Open Letter to Microsoft on why Microsoft Store should run on Sitecore

Interesting story, I went to the Microsoft Store in the United States to buy a Windows 8.1 Pack to upgrade my standard edition of Windows to Support installing Coveo.  As a Canadian, it would not let me purchase.  I spoke to a rep on the site and they said the easiest way was to purchase right through Windows and it would update the product key and install and everything.

I followed these instruction and got the product installed.  4 hours later Microsoft detects my abandoned cart on the site and having my email address from login email me offering me free shipping if I buy it.  How many ways did they get it wrong?

1) When I first arrived on the US site it should have detected my location and opted to switch me to the Canadian store.
2) When they sent the email I already bought the product.
3) I could not buy it from the Microsoft Store in the United States so sending me an email with the link to the United States cart would have frustrated me if I had not already bought.
4) It was 4 hours later after I had already attempted other means.

So what if Microsoft had Sitecore:

1) Sitecore supports IP detection that could then be used to redirect them to the proper site or provide them with an option of going to the Canadian store.
2) As the user is in an engagement plan, when I bought the product it could have bumped the engagement plan to show that state.
3) Using the engagement plan it would have detected the state change from buying it and would NOT have sent me the email offering me a better deal it would have thanked me for purchasing.
4) I guess in this case the Microsoft Marketing people set the delay on it so they could still mess it up.

Ironically, even though it had entered the key and installed the features, almost exactly after I got the email from Microsoft, Windows decided I needed to activate the key.  Not during my install but 4 hours later.  It provided no option to ignore and all I had to do was click the activate link as the product key was already automatically entered during install.

So if Microsoft is interested, Sitecore can do wonders for your store.  Simply implement Sitecore 7.5 with ActiveCommerce or Commerce Server and you are good to go.  Email us at if interested in discussing more.

Thursday, October 2, 2014

Why does position of p tag determine if edit frame will let me edit text in page editor

Ok so if I do this page editor will NOT let me edit the field:

<sc:EditFrame ID="contentEditFrame" runat="server"><p><sc:Text ID="content" runat="server" Field="Document_Content"></sc:Text></p></sc:EditFrame>

If I do this it works:
<p><sc:EditFrame ID="contentEditFrame" runat="server"><sc:Text ID="content" runat="server" Field="Document_Content"></sc:Text></sc:EditFrame></p>

curve ball, this works: 

        <sc:EditFrame ID="titleEditFrame" runat="server"><h1><sc:Text ID="title" runat="server" Field="Document_Title"></sc:Text></h1></sc:EditFrame><br />

so page editor why does the position of a p tag within editframe matter but not the h1 tag?

Can anyone explain?  At least now if your page editor does not work you can check this scenario.

If you have anything you would like to share with the guild please email me at​

Tuesday, August 5, 2014

ParseDataSourceString moved between version 7.1 and 7.2 of Sitecore

If you have upgraded from Sitecore 7.1 to 7.2 or sharing code libraries between 7.1 and 7.2 you may start getting an error message like this:

Method not found:  'System.Collections.Generic.IEnumerable`1<Sitecore.ContentSearch.Utilities.SearchStringModel> Sitecore.ContentSearch.Utilities.SearchStringModel.ParseDatasourceString(System.String)'.

The reason is that the ParseDatasourceString method moved between Sitecore versions.

In 7.1 you would find it in: Sitecore.Buckets.Utils.UIFilterHelpers.ParseDatasourceString whereas in 7.2 it can be found in Sitecore.ContentSearch.Utilities.SearchStringModel.ParseDatasourceString

The solution is to have two versions of your dlls or wrap this call in a third dll you can call from your larger library.  If you have the namespace the same in both projects you can swap them out for each version.

If you have any questions, tips, tricks or resources please email me at

Wednesday, July 30, 2014

Sitecore Saving vs Saved Event and when to use which

One of the developers I am mentoring asked me a good question and I thought I would share the answer with the guild in case you are wondering the same.

The question is related to saving items to an external DB when they are saved in Sitecore.  There are really two ways to handle it.

1) Write an Item Provider and store them in a single location.
2) Use the item save events but which one is the right one to use.

In our case it was more beneficial to use option 2.  Using Saved vs Saving depends on whether the external DB will store any data that will be calculated based on saved data rather than simply saving a copy.  Saved happens after the Sitecore item is saved where as Saving will allow you to perform additional operations on the Sitecore item prior to save.

The other thing to be aware of is that when an item is duplicated it will NOT call the saving or saved events unless the user explicitly hits save.  If you require duplicate items to make it to your database too then you will need to implement this event too.

John West wrote a really good article with sample code as well, called Intercepting Item Updates with Sitecore.

If you have any tips, tricks or resources you would like to share with the guild please email them to and we will post them here.

Wednesday, June 4, 2014

Having Trouble Finding a Sitecore Resource? Why Not Train one.

I recently wrote a quick article on LinkedIn regarding the current shortage of Sitecore talent called Having trouble finding s Sitecore resource.? Why not train one and am getting a lot of good feedback.

If you are interested in learning more on the best way to train a Sitecore resource to help build your team. Please contact us at and we will help.

On a side note, if you are a .NET Developer working with C# and are interested in working with Sitecore or Dynamics CRM, you can apply for our Mentorship Program.  If accepted, then we will mentor you on Sitecore or Dynamics CRM.  We will provide you with a project to work on with us that will build your skills and allow you to make some money at the same time.

To apply for the Mentorship Program please email your resume along with details on why you want to work with Sitecore or Dynamics CRM to

We look forward to working with you to achieve your goals.

Tuesday, May 6, 2014

Sitecore 7.x and Internet Explorer 11 and Content Item Fields get covered in Grey Box

Here are the steps to reproduce:

1) Open Internet Explorer 11.
2) Log into the Sitecore Admin selecting Content Editor.
3) Click on a node in the tree.
4) On the right hand side move the mouse around, especially over the edit html for a rich text field.  The whole field panel will turn grey.
5) Click on a node in the tree and the grey will disappear and fields will come back.

WORKAROUND: Open windows explorer and edit \sitecore\shell\Themes\Standard\Default\content manager.css

The editorFrame style has the following:
#EditorFrames {
  width: 100%;
  position: absolute;
  top: 0;
  bottom: 0;
  margin-top: 25px;
  background: white;
In IE 11 this will width:100% will not work properly.  Change this style to:
#EditorFrames {
  width: 100%;
  position: absolute;
  top: 0;
  bottom: 0;
  margin-top: 25px;
  background: white;
This will resolve the issue however since this is a Sitecore file you have to be careful during upgrades that this fix is not overwritten.

Sunday, April 13, 2014

Possible Sitecore Hackathon as part of Sitecore User Group Conference 2014

Back on January 24, 2014 something amazing happened, the First ever Sitecore Hackathon.  9 Teams from various nations took part and had lots of fun.  Thanks to Akshay Sura (@akshaysura13) for arranging the first one.

Its looks like the next one will take place in person at the end of the Sitecore User Group Conference 2014
If you are able to take part please register here.  Also please forward on the registration information to everyone you know.  The more teams taking part the more fun it will be.

Look forward to Twitter commentaries and hearing the results of all the amazing modules that will come out of this.  Also look forward to many more.

Thursday, April 10, 2014

Sitecore 7, The Data Source and the GUID

For those looking at upgrading from Sitecore 6.x to 7.x beware of a subtle advancement that is very beneficial in most situations but a major issue in another.

Scenario #1:  A client is migrating from an existing CMS and pulls the content from the existing cms into Sitecore on a regular basis during migration to reduce the size of the outage windows for Clients.

Scenario #2:  A client injects data into Sitecore from an external system via clearing all the nodes under a certain node in sitecore and then re-imports the content items.

In both these scenarios the Guid would chance for the content item but the path would remain the same.
In Sitecore 6.6, this would work fine as the DataSource property of the sublayout stored the Item Path.

In Sitecore 7.0, a cool advancement was introduced that allowed you to move content around and it would automap the DataSoure much like it does with content links.  Nice feature but in the above scenarios it will break existing SubLayouts.

Workaround: This is not ideal but if you place text in front of the item path eg. "ITEM_PATH:" then sitecore cannot resolve the sitecore path so it will keep the string there.  Then in the sublayout when you grab the DataSource you look for that string and remove it before calling GetItem.  Here is some sample code:

                if (string.IsNullOrEmpty(subLayout.DataSource))
                    return Sitecore.Context.Item;
                string dataSource = subLayout.DataSource;
                Item dataSourceItem = null;

                if (dataSource.StartsWith("ITEM_PATH:"))
                    dataSource = dataSource.Substring(10);

                if (Sitecore.Context.Database.GetItem(dataSource) != null)
                    dataSourceItem = Sitecore.Context.Database.GetItem(dataSource) ??
                    Log.Info("CurrentContextBased On Data Source (" + dataSource + ")", this);

Alternatively someone could override part of the mechanism to handle "ITEM_PATH:" much like Sitecore itself does currently with "query:"  If someone has created one, and is willing to share it in MarketPlace for others to use, let me know and I will reference it here for others to access.

If you have any tips, tricks or resources you would like to share with the Guild please email them to or and we will share them with the Guild.

Monday, March 24, 2014

E-Commerce Guild Blog

I would like to take this opportunity to welcome E-Commerce Guild to the Guild family.

This blog shares the same vision as our other Guild sites. It is designed to contain various Tips and Tricks to help you with your development projects, provide guidance, mentoring and assistance in relieving your pain points.

 If you know any Tips, Tricks or resources let us know and we can add them to this blog. If you have a particular pain point that requires assistance let us know as well. Please email us at for assistance.

You can also register at and we will reach out to discuss your needs.

Wednesday, February 26, 2014

Object of type System.Int32 cannot be converted to type System.Web.Security.Cryptography.Purpose

When you open the Sitecore Admin and Try to login you get this error:  

Well John West has the solution. This blog post explains how you can resolve the Object of type 'System.Int32' cannot be converted to type 'System.Web.Security.Cryptography.Purpose' error that you may receive when you try to access a user interface in the Sitecore ASP.NET web Content Management System (CMS) after installing Visual Studio 2012 or .NET 4.5. 

Check out the blog article

Thanks John you saved me some time and hopefully will save others on the Guild some time as well.

If you have any tips, tricks or resources you would like shared with the Guild please email them to me at and I will post them here.

Saturday, February 22, 2014

Accessing A Sitecore Item From an External Application

In order to access a Sitecore Item outside of Sitecore you need to use the Sitecore Web Services or

Step 1: Register the Sitecore Web Service with your application.  This is done by adding a reference.
You want a web reference not a service reference so be sure to click Advanced and click Web Reference.
The service can be found at

http://{sitecore server url}/sitecore/shell/WebService/service.asmx?wsdl

Step 2: If you require getting item by Sitecore Path then you need to my Sitecore Get Item Id For Item Path Web Service Module in Marketplace. You would place the dll in the right folder and the asmx in the services folder to access it.

Step 3: Connect to the web service and get the item path for the id.  If you already have the path then ignore this step.
                com.scws.itempath.ItemPathService service = new com.scws.itempath.ItemPathService();
                service.Url = serverUrl + "/sitecore/shell/webservice/ItemPathService.asmx";
                string itemId = service.GetItemId(databaseName, itemPath);
                                return "<dataset><item_id>" + itemId + "</item_id></dataset>";

Step 4: Get the item based on the Sitecore Path.  The service returns an xml but you then wrap it in dataset tags and you can stuff it in a dataset to query it.  NOTE: Replace {sitecore_path} with the path you want to retrieve the item for.

            com.scws.Credentials cred = new com.scws.Credentials();
            cred.UserName = userName;
            cred.Password = password;
            com.scws.VisualSitecoreService service = new com.scws.VisualSitecoreService();
            service.Url = serverUrl + "/sitecore/shell/WebService/service.asmx";

            // Verify Credentials
            var xn = service.GetXML({sitecore path}, false, databaseName, cred);
            return "<dataset>" + xn.InnerXml + "</dataset>";

This should work to get your item.  If you have any questions please email or and we will assist.