-
Using Microsoft Computer Vision to generate alt text to your images in Sitecore
Alt texts are more important than people might think. They can make a huge difference in SEO scoring, placing you higher up in the search results like Google or Bing. Your alt-texts should be more than just “bird”, if it’s an image of a bird. Because it also gives value to those with any visual…
-
Custom database, custom index and ContentSearch
Lets go over how we can setup a custom database with a custom index then query it with Sitecore ContentSearch. You could also skip step 1 if you’re getting your data from somewhere else that’s not stored in Sitecore as items. 1. Create database If you’re using SQL open Sql Server Management Studio and add…
-
Publish-dates in Sitecore without itemextensions
I’ve read everywhere that you cannot get “first publish” and “last publish-date” from Sitecore out of the box and must write an extension for this. While true, I also believe you can use something else. Let me explain. In my case I wanted to get “last publish-date” on an Article pagetype. This page is indexed…
-
Solr Index issue – empty index periodically
If you have a working index and search result and you find that it starts to get empty all of the sudden on what seems to be an interval, Sitecore is probably rebuilding the entire index for you based on a job agent. There is a default Threshold of 100k that tells Sitecore to trigger…
-
Sitecore Scheduled Tasks – Database Agent
I just want to briefly explain how the database agent work because I’ve noticed a lot of confusion about it and why it behaves like it does. – “Why aren’t my tasks running!?”– “Is there something wrong with my interval?” These are just some of many questions that might pop up as a new developer…
-
Sitecore custom personalization rule
In this case i’m going to use personalization to check whether a visitor has logged in through our custom login portal or not. Based on this I want to show different datasources for let’s say our Hero banner. Check my previous post how to use rules and select datasources here. 1. Create custom rule Step…
-
Installing Sitecore publishing service 6.0
I’m going to show you how to install Sitecore Publishing Service version 6.0 as the .NET Core runtime option. 1. Download all the essential packages & prerequisites. 2. Install Publishing Service 3. Configure connectionstrings 4. Upgrade database schema Now it’s time to upgrade the database schema with the connectionstrings from step 3. As I wrote,…
-
Get Sitecore environment in code
I wanted a rendering to spit out different HTML based on environment and I wanted to share one way to do this by using environment transformation configs and sitecore settings. Here I would have a config for each environment with a different value for example: Now I can get the environment value from this config…
-
How to personalize content in Sitecore 9.3
I want to make a short post with the easy peasy version how to setup personalization in Sitecore 9.3. I will post links and resources at the bottom of the post for those who want to read the in depth guides and posts out there how it all works. I will return with a second…
-
Sitecore & Solr “connection lost”
Search was not working and when I went to the Solr admin page it said “Connection lost”. The exact reason for why this happened in the first place i’m still investigating. But to fix the error first was to reset the Solr instance and recycle the App pool of the site. You can do this…
-
Using influxDB with Sitecore Part 2
This is a continuation of Part 1 where I go over how to setup influxdb to monitor Solr. If you haven’t read it and are looking for installation guides for influx, check out part 1 here In this PART 2 I want to setup some basic statistics for when visitors hit a 404 or a…
-
Get items from Bucket in Sitecore
I need to get items from a big bucket. For best performance you should get the items through Sitecore ContentSearch. Here I have some example code how to get a selection of items from a bucket. Let’s say I want to get items that has a specific Tag on a field, which in this case…
-
Sitecore installation setup UI
Just had to make a quick post about this because apparently I’ve been living under a rock. I’ve used SIF and setting up configs on my own every time I’ve setup a new sitecore instance. Which now in hindsight has been a giving lesson to learn the basics. I mean if you’re just after a…
-
Sitecore shutting down – initialization error
The problem: All I could see in the log file was that error message “sitecore shutting down – initialization error“. This didn’t tell me much of where the issue was coming from except when Sitecore is spinning up. So I took a look in the Event viewer to check out any logs there. Open “Event…
-
Using InfluxDB for monitoring Sitecore’s Solr PART 1
Heard of InfluxDB before and what is it used for? “InfluxDB is an open-source time series database (TSDB) developed by the company InfluxData. It is written for storage and retrieval of time series data in fields such as operations monitoring, application metrics, Internet of Things sensor data, and real-time analytics.” – Wiki So it’s a perfect…
-
OData v4 $filter exclude empty array from result
If you want to filter out empty results you can end with $filter=Product/Categories/any() I had to query out some nested properties via Odata v4 and it was up to 140k results without a proper filter. I have a List of Products that each contains a List of Categories. If I just query like Product($select=Id;$expand=Categories($select=Id,Name)) I…
-
Add custom buttons to Dashboard/Launchpad
A neat way to execute or show some custom functionalities is to create a custom button for the Sitecore Dashboard/Launchpad (whatever you call it, I say Dashboard). This is very simple and you can easily make the button either for example a) open an aspxb) show custom viewsc) make an API request to one of…
-
Replace non-english characters
I needed to replace swedish characters from string without removing the character for itemname. With Sitecore you can use ItemUtil.ProposeValidItemName() but it removes the invalid characters. I have a text like “Flöde” and I want it to be “Flode” and not “Flde” like Sitecores ItemUtil does. Then I can use the following code: byte[] b…
-
Custom caching with Sitecore Cache
Performance is key. We have all know this. Customers has very high expectations on fast solutions. And this is where caching is king. There are many caching soultions out there today, like Reddis cache. You can also build your own layer if you’d like. Or you can use Sitecores. Sitecore has their own caching framework…
-
Sitecore Solr – Select specific fields with LINQ to Sitecore
If you’re expecting a lot of results from a Solr query, it can be quite a perfomance hit. If you then only really need 1 or 2 fields from the document, there is a neat way with LINQ to Sitecore to select only the fields you need. By using the .Select() you can specify which…
-
Sitecore xConnect error GetEntityOperation
This error message caught my eye on xConnect in Sitecore 9.3, which looked like this. This issue was because of Xdb had wrong ServerName in the [*.Collection.ShardMapManager] database. The database and table “[*.Collection.ShardMapManager].[__ShardManagement].[ShardsGlobal]” that contains [ServerName] and [DatabaseName] columns. Replace with your ServerName and hopefully this will be the issue in your case. Hope this…
-
Sitecore Solr Sort Alphabetically
Just a short and quick blogpost. I got an issue with my alphabetically sort. This was because my field was tokenized and of type text in Solr. So I had to make the field Untokenized and returnType string. Fixed! With Sitecore you can pretty easy sort by Ascending or Descending with LINQ to SitecoreJust write…
-
Sitecore 10.2 Feature summary
Sitecore released the new version, 10.2 recently and I wanted to make a quick summary of some of the features that stood out to me. For full Release Notes please check Sitecores doc here: 10.2 Release Notes Decrepcated New features