I got a feature request that I should store something on session start. In the old ASP.NET Framework world it was easy because we had Globbal.asax.cs
and its Session_Start
event. The original answer to this question is here. But, as I prefer overengineering modular architecture and Sitecore Helix principles I wanted to make it extensible without touching this Foundation piece of code. As you probably know we have Startup.cs
instead of Global.asax.cs
and DistributedSessionStore
. To extend the Create method of the DistributedSessionStore
you can just simply inherit from its interface ISessionStore
.
Author: trnktms
Find and replace external URL references with internal link
The requirements are the following:
- We have thousand of rich text components which has URL references to external pages
- These references needs to be replaced by an internal Sitecore item reference based on a field of the pages
Find item duplicates with Sitecore PowerShell
Should I say anything? The code explains itself 😊
Continue reading “Find item duplicates with Sitecore PowerShell”Diagnose Solr connectivity issues on production
This blog post is for you if you find the following warnings in Sitecore logs:
[Index=<indexname>] Crawling Paused
[Index=<indexname>] Synchronous Indexing Strategy is disabled while indexing is paused.
IndexingStateSwitcher: Indexing is not resumed since indexes have not been initialized yet…
Exception: SolrNet.Exceptions.SolrConnectionException, Message: Unable to connect to the remote server
Switching from TDS to Unicorn – some useful verifying SQL scripts
On of my project we switched from TDS to Unicorn. After we configured Unicorn and set up dependencies between configurations I wanted to verify that every item was migrated from TDS (*.item
) to Unicorn (*.yml
) in the database successfully.
Solr install – Unrecognized VM option ‘PrintGCDateStamps’
I wanted to install Solr 6.0.1 on my brand new laptop for Sitecore 8.2 after I already installed Solr 7.2.1 for Sitecore 9.1. I thought it will be easy because I have already a Java environment installed. I had 2 issues.
Continue reading “Solr install – Unrecognized VM option ‘PrintGCDateStamps’”Custom layout resolver
Sitecore provides you the possibility to implement your own layout resolver if the default one is not enough for you. Basically you can change the layout of a page based on a business logic without changing the item in the database.
Continue reading “Custom layout resolver”Glass Mapper – SitecoreContext.Database is null
In the last days I had to discover why on first load of the IIS site SitecoreContext.Database is null.
Continue reading “Glass Mapper – SitecoreContext.Database is null”What WorkflowUtility.ExecuteWorkflowCommandIfAvailable does?
This will be a short post about why the method above is tricky. As its name says ExecuteWorkflowCommandIfAvailable
, but what “available” means in this context?
Template dependent field validator WITHOUT Sitecore rules engine
A year ago I have posted about how to create template dependent field validator with rules engine. But it requires too many modifications, so I have decided to write this post about how to do the similar functionality without rules engine.
So at first I have implemented a base class which should be used by all validators which want to be dependent on a template or a base template. This class does the following steps:
- Checks the template ID and base template ID of the current item
- If it is true then the main part is called, this is the following line:
return evaluate();
This is the injected specific validation method which is passed as a parameter.
Continue reading “Template dependent field validator WITHOUT Sitecore rules engine”