Monday, February 29, 2016

Sitecore document manager in rich text editor coming up empty

When using the document manager in the rich text editor of Sitecore 8, the UI would be coming up empty but saying it was showing x items of x.

A fix for this one is to make the following change to the EditorPage.aspx file located at Website\sitecore\shell\Controls\Rich Text Editor.

Sitecore Lucene indexing child content against an item

This post is logic for indexing child items, please also see indexing sublayout or rendering data sources.

Sitecore Lucene search indexes and code can be simple to implement when a given item contains all of the fields which will need to be indexed against itself. This can get more complicated when it comes to sublayouts/renderings which contain content from a datasource (another item).

One solution is to create a custom index field which concatenates the content from child items/datasources into the Lucene index against the main item. This way all of the content that makes up a page is indexable against that page.

Sitecore Lucene searching by phrase and each of its words

With simple implementations of search in Sitecore, one might be using search to find items in the index where the content is like or contains the exact search term. This works well if a user is searching for a given keyword, however if they enter a phrase we would also want to return results which match certain words in that phrase (albeit with less of a boost).

This can be achieved using the predicate builder in Sitecore, along with the standard search code and indexes in Lucene. In this example I am searching on a simple Sitecore page template, and in particular 3 of it's fields: title, page description and main text. These fields have been included in the custom Lucene index XML and have the storage type set to true (this means I can access the data stored in the fields from the search index without having to get the Sitecore item).

Friday, February 26, 2016

Visual studio solution nuget targets not found on opening project

When attempting to open a visual studio project that contains nuget packages from a custom source on another environment, the following error may appear:
The imported project [project location]\.nuget\nuget.targets was not found. Confirm the parth in the <import> declaration is correct, and that the file exists on disk. [project location]\[project name].csproj

Sitecore content editor Post condition failed

On a Sitecore development machine (single server environment), the front-end was loading correctly but when attempting to load the content editor the following error appeared in the logs:

Post condition failed

Tuesday, February 23, 2016

Taking your first bite into Sitecore's marketing cababilities

One of the biggest selling points for Sitecore, and the area which I am really passionate about are the marketing capabilities. More often that not, these take a back seat to the initial implementation of the web site and the inevitable phase two where the nice to haves and additional features are implemented. It's at this point where the site is up and running and there is a baseline of site visitors that you can take your first bite into the marketing suite which Sitecore has to offer.

I am using the metaphor bite here, because it's important to understand the concepts, plan how they will be implemented on your web site and ultimately review the results. From there you can really start to chew and implement the more advanced marketing aspects.

Thursday, February 18, 2016

Sitecore tracker and sessions errors

The following errors were appearing inside the Sitecore logs:
ERROR Cannot create tracker.
WARN [WFFM] CurrentSession is not initialized
ERROR SessionEndPipeline failed.

Sitecore Failed to perform MaxMind lookup

On the Sitecore multi-server setup I was getting errors relating to GeoIP lookup in the CD server logs:
ManagedPoolThread #5 08:52:34 ERROR Failed to perform MaxMind lookup
ManagedPoolThread #5 08:52:34 ERROR Failed to perform GeoIp lookup for [GUID]
Exception: Sitecore.Analytics.Lookups.CannotParseResponseException
Message: Unexpected format. Cannot parse the MaxMind response for IP address: [IP]

Source: Sitecore.Analytics
   at Sitecore.Analytics.Lookups.MaxMindProvider.GetInformationByIp(String ip)
   at Sitecore.Analytics.Lookups.GeoIpManager.GetDataFromLookupProvider(GeoIpHandle geoIpHandle)
This is due to the Analytics.PerformLookup setting in the Sitecore.Analytics.config file. Only one server should be responsible for performing these lookups, so I disabled the lookup on CD servers using a patch file.
<configuration xmlns:patch="">
   <setting name="Analytics.PerformLookup">
     <patch:attribute name="value">false</patch:attribute>

Wednesday, February 17, 2016

Sitecore WFFM Error ReportDataProvider

On Sitecore 8/8.1 the following error appears when attempting to load a web form via a content delivery server:
Unable to cast object of type 'System.String' to type 'Sitecore.Analytics.Reporting.ReportDataProvider'

Monday, February 15, 2016

Using Sitecore for an intranet site

In the world of web sites the Sitecore Experience Platform is the market leading CMS, with a feature set that empowers developers, content editors and marketers to deliver optimal results in their relevant areas. However when it comes to intranet sites, SharePoint is still considered the default choice, which only splits the development team and limits the features available for use. This post is going to investigate how Sitecore could be used in an intranet environment, and how it compares to SharePoint in this space.

Monday, February 1, 2016

Vagrant unable to download box

Whilst trying to download the ubuntu/trusty32 box for Vagrant I came across the following error:
URL: [""]
Error: Failed to connect to port 443: Timed out
This was due to my machine being behind a corporate proxy. To fix this error, setting the proxy details (both HTTP and HTTPS) allowed the box to be downloaded.
set http_proxy=http://[proxy]:8080
set https_proxy=http://[proxy]:8080
The vagrant-proxyconf may also need to be installed, but the command "vagrant plugin install vagrant-proxyconf" doesn't always work - due to the corporate proxy. To install it manually:

  1. Download the gem here.
  2. Place it in the folder where your vagrant file is located and change directory there using a command prompt
  3. Run the command "vagrant plugin install vagrant-proxyconf-1.4.0.gem"