contact@skillcore.net

Sitecore Rules Engine - Has Visited Certain Page Given Number Of Times Condition

Posted 22 June 2017 by Marek Musielak

sitecore rules engine

I've recently saw a question on StackOverflow where one asked how to „make a module on a page show up the first time you visit the page“. There is a Sitecore built in rule "where the [specific page] has been visited during the current visit" but the code which counts the page visits is called before the rule is executed, so if you try to use "except where the [specific page] has been visited during the current visit", it will always be false on that specific page, even when you open it for the first time. I haven't found any OOTB solution, so I've created my own condition: HasVisitedCertainPageGivenNumberOfTimesCondition.

continue reading Sitecore Rules Engine - Has Visited Certain Page Given Number Of Times Condition »

Sitecore Template Manager - fix for the Tab key

Posted 12 June 2017 by Marek Musielak

sitecore template manager - fix for the tab key

Editing Sitecore templates - every Sitecore developer does it. It doesn't matter if you're using Template Manager application or if you create and edit Sitecore templates in Content Editor, there is one thing which is broken in both. It's the tab key functionality.

continue reading Sitecore Template Manager - fix for the Tab key »

Sitecore Item Controller - the hidden gem of Sitecore MVC

Posted 27 November 2016 by Marek Musielak

sitecore page controller - sitecore item controller - sitecore layout controller

Not many people know about Sitecore Item Controller and what its role in Sitecore MVC is. is responsible for executing PageContext.Current.PageView property, which runs mvc.getPageRendering pipeline and returns html defined by the Sitecore MVC item layout. OK, so why is it important and how can I use it? One thing you can do is changing the way how Sitecore executes MVC page requests. Interesting but a little bit scary. I wouldn't trust that after upgrading to the next Sitecore version, my code still works. But there is another thing you can do. You can execute any code you want before or after Sitecore renders any MVC page. You can say that with httpRequestBegin and httpRequestEnd pipelines you can do the same. That's true, but with Sitecore Page Controller you can define different code for every template or even item. How? Read the post to see how I used Sitecore Item Controller and Sitecore Rules Engine to allow Sitecore Editors to use Rules Engine to specify different settings based on whatever condition they want.

continue reading Sitecore Item Controller - the hidden gem of Sitecore MVC »

Sitecore Rules Engine - decimal macro

Posted 16 October 2016 by Marek Musielak

sitecore decimal macro double macro floating point number macro

Some time ago I worked on a project where we had access to plenty of numeric data stored in the fields of our content items. The plan was to use this data to personalize the content on the site. Some of the data was decimal numbers. I hoped to use a built-in Sitecore macro which would allow me to create a condition like where the decimal value of field compares to number but to my surprise, there was no macro for decimal or any other floating point number.

continue reading Sitecore Rules Engine - decimal macro »

Sitecore Item Buckets - custom folders structure

Posted 3 December 2015 by Marek Musielak

sitecore item buckets - custom folder structure

Item Buckets allow you to store millions of items in Sitecore tree without worrying about the structure of the nested items. In theory, you should only use Item Buckets for the data which does not require any hierarchy. Also you should not have to browse the Sitecore content tree looking for items in the buckes. Still, sometimes we need to find an item in the tree and it's not that easy when the only help we have is default Sitecore date-based folder structure of Item Buckets. Fortunately, Sitecore allows to change the structure of Item Bucket folders easily.

continue reading Sitecore Item Buckets - custom folders structure »

Sitecore Insert Options Rules

Posted 25 November 2015 by Marek Musielak

sitecore insert option rules

One of the first thing which is explained to Sitecore Developers during the certification courses are Sitecore Insert Options. Everyone knows them. Configure -> Assign and it's all set. However not many people have ever heard about or used Insert Options Rules.

continue reading Sitecore Insert Options Rules »

Sitecore Preview Mode - see what is personalized

Posted 28 March 2015 by Marek Musielak

sitecore conditional renderings personalization preview

Sitecore personalization is a brilliant functionality. Every Sitecore implementation should make a proper use of it. If your application doesn't, it simply does not take the advantage of what Sitecore is capable of.

One thing I've always missed in Preview Mode of Sitecore Page Editor is an option to see which components are personalized and how do they look like in every personalized variant. You can do this in Edit Mode, but all the Sitecore javascripts, reloading the page when selecting personalized version and additional html tags added by Sitecore, they all intrude with proper initialization of components and with ease of use. This blog post explains how I added functionality of previewing Sitecore conditional renderings to the Preview Mode of Sitecore Page Editor. Video below shows how it works:

continue reading Sitecore Preview Mode - see what is personalized »

Sitecore - automated validation of MVC rendering DataSource

Posted 19 October 2014 by Marek Musielak

sitecore - automated validation of mvc rendering datasource

The project I'm working on now is based on Sitecore MVC. Lot of custom renderings, lot of configuration for them and lot of editable content. Most of the component data is stored in DataSource items and without DataSource item selected they make no sense and they don't provide any value. I was sick of placing if (DataSourceItem == null) { ... } code in every single component so I automated this process using Sitecore <mvc.getRenderer> pipeline.

continue reading Sitecore - automated validation of MVC rendering DataSource »

Using SwitchOnRebuildSolrSearchIndex Solr provider for Sitecore

Posted 5 October 2014 by Marek Musielak

sitecore and solr - custom field reader and indexing

Few days ago a colleague of mine, Dave, asked me why we hadn't been using SwitchOnRebuildSolrSearchIndex Solr provider in our Sitecore solution. I've heard about SwitchOnRebuild provider for Lucene but never about Solr one and neither had at that time Google. But SwitchOnRebuildSolrSearchIndex class exists so someone must know something. I asked about it on twitter. 13 minutes later Martina Welander replied to my tweet and one hour later I've received an email with documentation.

continue reading Using SwitchOnRebuildSolrSearchIndex Solr provider for Sitecore »

Sitecore and Solr - custom field reader and indexing

Posted 30 August 2014 by Marek Musielak

sitecore and solr - custom field reader and indexing

Nowadays Solr-powered Sitecore solutions are more and more popular and easier to setup. Stephen Pope and Sitecore team are doing great job there. Sitecore 7.2 provides a lot of support for Solr out of the box but there are still some scenarios when you need to extend Sitecore to fit your needs. Just recently I needed to implement a custom way of indexing and retrieving item fields for Solr.

continue reading Sitecore and Solr - custom field reader and indexing »
© Skillcore Sp. z o.o. 2017