Category: Sitecore

Sitecore : Dynamic Tag Enhancement for Algolia Search Provider

Sitecore-Blog-Hero-Image-3.png

While integrating Sitecore with Algolia Search Provider, I encountered a scenario where I needed to add many fields dynamically. The field name and value are both dynamic based on the content page.

Initially, I thought of it as a computed field, but then the field name is dynamic, and I was wondering how to add dynamic fields to the Index records.

The TagProcessor comes to the rescue – The existing Tag Processor ensures that tags are dynamically added, structured, and optimized before indexing, which outputs _tags in the indexing record.

Algolia Record Search:

 

Sitecore-Algolia-Serach-Provider-Tag-Processor-Computed-Fields-1.png

 

The config for the existing tag processor looks like this –

AlgoliaConfiguration.sc1021.config:

 

 

CategoryDataProcessor:

  • Since we needed to incorporate dynamic tags into our project, I began exploring the functionality of AlgoliaTagsProcessor. Creating another Tag processor, for example, CategoryDataProcessor –allowed us to generate dynamic tags efficiently.
  •  The ProcessDocument method ensures that the Sitecore items being processed match the expected Category Listing Template.
  • After Processing, the extracted data is added dynamically to the JObject doc to the Alglolia Index record.

 

 

  • However, this overwrites the existing_tags in Algolia index. I’m looking for a way to make both work together while also allowing the flexibility to add more dynamic tags in the future if needed.
  • Adding a wrapper class – AlgoliaCustomTagProcessor, which should loop through each Processor and call the ProcessDocument method.
  • This will ensure that each TagProcessor is called and doesn’t overwrite the existing _tags.

AlgoliaCustomTagProcessor:

 

AlgoliaDocumentBuilder:

Modify the AlgoliaDocumentBuilder to process both tag documents – 

  • Initialize the new CustomTagProcessor in the Constructor.
  • Add the GenerateCustomTags() method, which should call ProcessDocuments in the CustomTagProcessor class.

The following is the modified AlgoliaDocumentBuilder code – 

 

AlgoliaConfiguration.sc1021.config:

  • Let’s add the new CustomTagProcessor to the config file.
  • Now, we have two tag processors nested into each other and wrapped into our CustomTagProcessor class.
  • It can be extended to any dynamic Tags we want in the future.

 

The final dynamic category tags were added to the Algloia record, yay! 

It worked!

 

Sitecore-Algolia-Serach-Provider-Tag-Processor-Computed-Fields-2.png

Hope this helps.

Happy Sitecoring!

0

Optimizely CMS 12 and .NET 10 Upgrade: Resolving a TinyMCE Dependency Injection Exception

Framework upgrades often expose hidden compatibility issues that have remained dormant for years. While upgrading one of our Optimizely CMS solutions to .NET 10, we encountered a runtime exception that initially appeared to be a dependency injection problem but ultimately turned out to be an outdated TinyMCE package.

This post documents the issue, the investigation journey, and the surprisingly simple fix.

The Problem

After upgrading our solution to:

  • .NET 10
  • Optimizely CMS 12.34.4

the application failed during startup with the following exception:

AggregateException: One or more errors occurred.
 
Unable to resolve service for type
‘EPiServer.ServiceLocation.ServiceAccessor<EPiServer.Cms.TinyMce.Core.TinyMceConfiguration>’
while attempting to activate
‘DXP.Core.Model.TimelineBlockXhtmlStringEditorDescriptor’.

 

The exception pointed to our custom TinyMCE editor descriptor:

[EditorDescriptorRegistration(
TargetType = typeof(XhtmlString),
EditorDescriptorBehavior = EditorDescriptorBehavior.OverrideDefault,
UIHint = UIHint)]
public class TimelineBlockXhtmlStringEditorDescriptor
: XhtmlStringEditorDescriptor
{
public const string UIHint =
"TimelineBlockXhtmlStringEditorDescriptor";
 
public TimelineBlockXhtmlStringEditorDescriptor(
ServiceAccessor<TinyMceConfiguration> tinyMceConfiguration)
: base(tinyMceConfiguration)
{
}
public override void ModifyMetadata(
ExtendedMetadata metadata,
IEnumerable<Attribute> attributes)
{
// custom implementation
}
}

At first glance, it looked like a service registration or dependency injection issue.

Environment Details

The key package versions at the time were:

  • Optimizely CMS 12.34.4
  • EPiServer.CMS.TinyMce 4.8.3
  • .NET 10

The application had been working correctly before the framework upgrade, which made the issue particularly challenging to diagnose.

Initial Investigation

Our TinyMCE registration was straightforward:

services
.AddCmsAspNetIdentity<ApplicationUser>()
.AddCms()
.AddTinyMce();

and custom configuration was registered using:

services.Configure<TinyMceConfiguration>(config =>
{
// custom TinyMCE settings
});

Everything appeared to be configured correctly.

Testing on Alloy

To isolate the problem, we reproduced similar TinyMCE configuration in a clean Alloy solution running on .NET 10.

The result:

  • CMS started successfully

  • TinyMCE loaded correctly

  • No dependency injection errors

This immediately suggested the problem was not a generic Optimizely or .NET 10 issue.

Reviewing Custom Editor Descriptors

Since the exception referenced:

TimelineBlockXhtmlStringEditorDescriptor

we spent considerable time reviewing:

  • Editor descriptor registrations
  • Dependency injection registrations
  • Startup ordering
  • TinyMCE configuration extensions

Everything looked valid.

Checking Service Registration Order

We also reviewed whether .NET 10 had introduced behavioural differences in service registration and startup initialization.

Multiple registration orders were tested:

services.AddCms();
services.AddTinyMce();
services.Configure<TinyMceConfiguration>();

and

services.Configure<TinyMceConfiguration>();
services.AddCms();
services.AddTinyMce();

No change.

The Root Cause

After eliminating configuration and dependency injection possibilities, attention shifted to package compatibility.

EPiServer.CMS.TinyMce 4.8.3

Although the package had worked successfully before the upgrade, it was clearly not behaving correctly in the .NET 10 environment.

The Fix

We upgraded TinyMCE from:

EPiServer.CMS.TinyMce 5.0.3

After upgrading:

  • Application started successfully
  • TinyMCE initialized correctly
  • Dependency injection exception disappeared
  • Custom editor descriptors continued to work
  • CMS editor experience was fully restored

Happy Optimizely!

0

Custom Hidden Field in Sitecore Forms

Custom Hidden Field in Sitecore Forms

I came across a scenario in Sitecore Forms where I needed to build a hidden field. The form is intended for employees, and when they access it, it should automatically recognize them and capture their name and email address upon submission.

Let’s get started.

Create the Hidden Field in Core DB

  • Navigate to /sitecore/client/Applications/FormsBuilder/Components/Layouts/PropertyGridForm/PageSettings/Settings

 

  • Create the HiddenField based on /sitecore/client/Business Component Library/version 2/Layouts/Renderings/Forms/Form/Form Parameters

 

  • Fill out the following fields – 
    • Details 

Sitecore-Forms-hidden-field.png 

    • Validation

Sitecore-Forms-hidden-field-2.png

 

    • Conditions

Sitecore-Forms-hidden-field-3.png

 

    • Advanced

Sitecore-Forms-hidden-field-4.png

 

Create a Custom Field Type

  • Inherit from the StringInputViewModel class to create a new view model for your hidden field.

 

Create the View for the Field

  • Define the HTML and JavaScript needed to render the hidden field and set its value.

 

Custom Submit Action

Let’s create a custom submit action and read the properties from formSubmitContext.

Let’s bind it to the Form’s Submit Action.

Sitecore-Forms-hidden-field-7.png

Now I’m able to drag and drop the hidden field into the Form. 

Make sure to publish the Form and its related items.

Sitecore-Forms-hidden-field-6-1.png

Hope this helps.

Happy Sitecoring!

0

Coveo Computed Field for Retrieving Page Content and Renderings in Sitecore

I needed to index all text from the page content and its associated renderings, including single-line, multi-line, and rich text, into a single Coveo-computed field.

Let’s get started.

Text Extraction:

  • Created a TextExtraction class that inherits BaseComputedField.
  • GetComputedFieldValue: Computes the concatenated text from the item and its renderings.

  • GetRenderingSource: Retrieves the source item for a given rendering reference.

  • GetDatasourceItem: Resolves and retrieves the data source item using the pipeline manager.

  • GetAllReferencedText: Extracts text from fields and adds them to a result list.

  • GetReferenceFieldData: Handles reference fields and extracts text from referenced items.

 

 

Configuration:

Let’s add the TextExtraction computed field into the config file.

 

I published all the files, and it’s time to check.

I selected the page that has many renderings and hit Rebuild Tree (I set the indexing strategy as SyncMaster. If you have intervalAsyncMaster or onPublishEndSyncSingleInstance, publish the item to see the record in Index.)

If any issues, you can put a breakpoint in Visual Studio, and Rebuild Tree will hit the breakpoint to debug.

 

Let’s check the Coveo index – Yay! Its page content and its associated rendering content were extracted successfully.

Hope this helps.

Happy Sitecoring!

0

2025 – Contributions

The year 2025 has been great, featuring presentations at various Sitecore User Groups around the world and meaningful interactions with numerous members of the Sitecore community.

Blog Posts : 

Presentations : 

Feedbacks: 

  • August 16, 2025  –  Alpha Reviewers: Content Hub Developer Exam

 Co-organized SUG-Pittsburgh Meetups: 

Co-organized SUG-Philadelphia Meetups: 

 Conferences I attended: 

  • MVP Lunches   
  • MVP Webinars 
  • All SUG Pittsburgh and Philadelphia meetups  
  • Many SUG Boston/ Columbus/ Atlantic meetups 

Plans for 2026: 

Learn and contribute: 

  • Sitecore AI
  • Sitecore Saas Offerings 
  • Containerization 

Co-organize : 

  • Monthly SUG-Pittsburgh meetup 
  • Quarterly SUG-Philadelphia meetup 

Present: 

  • SUGCON EU/Symposium 
  • SUG Meetups 

Happy Sitecoring!

0

Sitecore Personalize Demo using TamperMonkey

 

Sitecore Personalize Demo using TamperMonkey.png

I started exploring Sitecore Personalize, which allows to craft tailored web experiences based on customer behavior and preferences.

In this blog, I’ll walk through how to integrate Sitecore Personalization for the Sitecore XP/XM/XMCloud website without installing EngageSDK – using TamperMonkey, a browser extension for running custom JavaScript.

Create a Point Of Sale (PoS)

In Sitecore CDP or Personalize create a PoS for the website.

Sitecore-CDP-Personalize-Popup-TamperMonkey.png

 

Create a Web Experience

In Sitecore Personalize, let’s navigate to the Experiences section and click Create New Experience.

Select from experience types such as:

  • Web Experience (e.g., personalized banners or pop-ups)
  • Interactive Experience (e.g., Chatbots, real-time API integrations)
  • Triggered Experience (e.g., email, push notifications)

Sitecore-CDP-Personalize-Popup-TamperMonkey-21.png

Sitecore-CDP-Personalize-Popup-TamperMonkey-3-1.png

OOTB Templates

Sitecore Personalize offers 14 out-of-the-box (OOTB) templates for creating web experiences. These templates are designed to help you quickly set up and customize your web experiments and experiences without needing to write code. Here are some of the templates available:

  1. Alert Bar (Boxever Library)

  2. Corner Popup (Boxever Library)

  3. Email Capture Bar (Boxever Library)

  4. Email Capture Corner (Boxever Library)

  5. Notification Widget (Boxever Library)

  6. Popup takeover (Boxever Library)

  7. Sidebar (Boxever Library)

  8. Alert Bar (Sitecore Library)

  9. Corner Popup (Sitecore Library)

  10. Email Capture Bar (Sitecore Library)

  11. Email Capture Corner (Sitecore Library)

  12. Notification Widget (Sitecore Library)

  13. Popup takeover (Sitecore Library)

  14. Sidebar (Sitecore Library)

Select any of the out-of-the-box templates or custom web templates, if they have been created.

Sitecore-CDP-Personalize-Popup-TamperMonkey-4.png

Let’s start to customize it. You have the option to use Advanced Edit for HTML, CSS, and JavaScript to enhance web templates.

Sitecore-CDP-Personalize-Popup-TamperMonkey-4.png

The final Popup looks like this – changed the following 

  • Background color
  • Title
  • Description
  • Button Text

Sitecore-CDP-Personalize-Popup-TamperMonkey-6.png

 

Page Targeting

I chose all the pages for simplicity.

Sitecore-CDP-Personalize-Popup-TamperMonkey-7.png

 

If you like specific pages – add the condition for the page URL.

Sitecore-CDP-Personalize-Popup-TamperMonkey-17.png

Goals

I chose not to track performance for testing purposes. Feel free to add any goal according to website needs.

Sitecore-CDP-Personalize-Popup-TamperMonkey-8.png

Filter, Decisioning, and Notifications

They are optional, going to leave them as it is. The Decision Model is so powerful that, will be exploring it in upcoming blogs.

Preview

Let’s Preview what it looks like – 

https://madhuanbalagan.com/?bxQATool=true&bxFlowRef=f536d1f2-646d-406e-8bb4-7e434912ce6b&bxVariantRef=77069aa5-dd50-44d2-ac5b-243ff8c246f6

The preview isn’t working because the EngageSDK needs to be installed on the website. If you have EngageSDK installed on the website, feel free to skip the TamperMonkey part.

Now this is where the TamperMonkey plugin comes to the rescue to pre-load the Engage SDK on any website using Sitecore Personalize script.

Download TamperMonkey Chrome extension –http://chromewebstore.google.com/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en

Note: Make sure it is enabled and the Developer mode is turned on.

Sitecore-CDP-Personalize-Popup-TamperMonkey-11-1.png

 

Let’s make a new script. By default, TamperMonkey uses the website domain where you clicked ‘New Script’ as a match. 

Sitecore-CDP-Personalize-Popup-TamperMonkey-12.png

Replace the following placeholders – 

The clientkey is found in CDP->Settings->API Access

Sitecore-CDP-Personalize-Popup-TamperMonkey-2-1.png

 

Let’s add the script to TamperMonkey and save it. The @name value determines how the script is named.

Now it should detect the script when you visit the website.

Sitecore-CDP-Personalize-Popup-TamperMonkey-13.png

 

Live

Let’s publish the Experience to make it live – If you have a notification set, it will email when it’s live, paused, etc.

Sitecore-CDP-Personalize-Popup-TamperMonkey-2-1.png

The email notification is pretty helpful especially for Marketers to track their Experiences.

Sitecore-CDP-Personalize-Popup-TamperMonkey-20.png

 

 

Preview

Let’s try the Preview – make sure to add a new script for the preview URL in TamperMonkey. 

Let’s load the Preview with the page URL.

Sitecore-CDP-Personalize-Popup-TamperMonkey-16.png

The Popup showed up and the QA Tool shows at the left side of the page.

QA Tool

The QA Tool shows the validation of everything. Feel free to change the variant to test different scenarios. It’s super helpful for troubleshooting any issues.

Sitecore-CDP-Personalize-Popup-TamperMonkey-14.png

Testing

Let’s reload the page, Yay! Popup showed up!!

Sitecore-CDP-Personalize-Popup-TamperMonkey-15-2.png

Hope this helps.

Happy Sitecoring!

0

Sitecore Forms : Custom Validation to Exclude the Default Value for Dropdown

Blog-Sitecore-Favorite-Tools (2).png   

I came across a scenario where I needed to exclude the default value for dropdowns in Sitecore Forms. By default, dropdown fields in Sitecore Forms often preselect the first option, which might be a placeholder like “Select an option.”

If users submit the form without changing this value, it can lead to unreliable data. Custom validation helps enforce user interaction, ensuring the selection is meaningful.

 

Steps to Implement Custom Validation in Sitecore Forms

 

Step 1: Create a Custom Validator

  • Navigate to your Sitecore solution and open the project where Sitecore Forms is configured.
  • Create a new class that extends FormConditionalValidator and override the validation logic.

 

 

Step 2: Register the Validator in Sitecore

  1. Open Sitecore Content Editor and navigate to:
    /sitecore/system/Settings/Forms/Validation
  2. Create a new validation item:
    • Name: Department Validator (Change it according to Project needs)
    • Type: Reference the class you created, e.g., Custom.Validators.DropdownDefaultValueValidator, CustomAssembly
    • Message: "{0} is required"
    • Parameters: "{"fieldToCompare":{Guid-of-the-dropdown}", "valueToCompare": "Select"}
  3. Save and publish the changes.

Sitecore_Forms_Validation-1.png

 

Step 3: Apply the Validator to Your Dropdown Field

  1. Open your form in Sitecore Forms Designer.
  2. Select the Dropdown field where validation is needed.
  3. Under the Validation section, add the newly created validator.
  4. Save and publish the form.

Sitecore_Forms_Validation-2.png

Let’s test – It’s working! Yay!!

Hope this helps.

Happy Sitecoring!

 

0

Sitecore – Favorite Free Add-On Modules

Over the years, I’ve worked with numerous Sitecore modules that simplify our tasks and boost efficiency.

Sharing my favorite free modules – 

  1. Sitecore Powershell Extensions
  2. SiteCron
  3. Azure Tools
  4. Sidekick
  5. Content Export Tool
  6. Sitecore Log Analyzer

Sitecore PowerShell Extensions

Sitecore PowerShell Extensions (SPE) (Huge thanks to Michael West, Adam Najmanowicz, and contributors) is a robust module that adds the power of PowerShell scripting to the Sitecore platform.

It empowers Sitecore developers and administrators to automate repetitive tasks and extend Sitecore’s functionality with custom scripts.

https://github.com/SitecorePowerShell/Console

Check out my PowerShell script blogs – 

https://madhuanbalagan.com/efficiently-bulk-edit-sitecore-content-using-sitecore-powershell-extensions-spe

https://madhuanbalagan.com/bulk-update-fields-using-spe

https://madhuanbalagan.com/migrate-sitecore-media-library-assets-to-dam

SiteCron

The SiteCron Module (a huge thanks to Akshay Sura) is a valuable tool for managing and scheduling tasks within Sitecore.

It provides a flexible way to automate and run various Sitecore jobs, such as publishing, indexing, or custom tasks, on a scheduled basis. 

Check out the installation and recent blogs – 

https://akshaysura.com/2017/09/07/sitecore-scheduling-with-sitecron-2-1-6/

https://akshaysura.com/2018/04/19/sitecore-precision-scheduling-with-sitecron-3-0-4-released-in-powerful-ways/

Azure Tools

Downloading Sitecore Logs from Azure Web Apps wasn’t easy. To troubleshoot any issues, I used to spend decent time trying to find recent logs. 

AzureTools (Thank you Sitecore Community – You are simply awesome!) comes to the rescue. It’s a simple .aspx page that can be dropped into CM environments and download logs in just seconds. 

Check out my detailed blog –  https://madhuanbalagan.com/instantly-download-sitecore-logs-from-azure-web-apps

Sidekick

To pull content locally, we relied on packaging content from upper environments or restoring the database – which was quite time-consuming.

The Sitecore Sidekick module (a big thanks to Jeff Darchuk) was a lifesaver for quickly pulling content into local or lower environments.

Sitecore-sidekick-install-download-content-migration-4.png

Sitecore-sidekick-install-download-content-migration-6.png

Take a look at my in-depth blog on installation and setup –  https://madhuanbalagan.com/sitecore-sidekick-installation-and-setup

Content Export Tool

The Sitecore Content Export Tool (many thanks to Erica Stockwell-Alpert) is a powerful utility designed to streamline the process of exporting content from your Sitecore instance.

It enables developers, content authors, and administrators to easily extract content in bulk, simplifying tasks like data migration, content backups, or sharing content across environments.

Explore the usage guide and documentation –https://ericastockwellalpert.wordpress.com/2017/08/24/content-export-tool-for-sitecore/

 

Sitecore Log Analyzer

The Sitecore Log Analyzer (SCLA) (Sitecore Community Rocks!) is a powerful tool designed to help Sitecore developers analyze and interpret log files with ease.

It simplifies the process of identifying issues, tracking errors, and monitoring system performance by providing a user-friendly interface to view and filter Sitecore logs.

This ClickOnce installer sets up the application and enables automatic updates. After installation, the app can be launched from the Start menu or pinned to the taskbar for easy access.

https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB0870095

Hope this helps.

Happy Sitecoring!

0

Algolia Search Provider for Sitecore 10.2.1

Algolia Search Provider for Sitecore 10.2.1

The Algolia Search Provider for Sitecore is a powerful integration combining robust content management capabilities with Algolia’s lightning-fast, full-text search engine.

This provider enables Sitecore-driven websites and applications to deliver instant, relevant, and highly customizable search experiences to end-users, ensuring faster content discovery and improved user engagement.

While exploring, I found that Dmitry Harnitski and Peter Procházka have implemented the Algolia Search Provider for Sitecore 9.1 and previous versions. Thank you so much!

https://github.com/dharnitski/Sitecore.Algolia

https://github.com/chorpo/Sitecore.Algolia/tree/sitecore91

Upgrading to Sitecore 10.2.1

The following are the steps taken for upgrading Sitecore 10.2.1 – 

  •  I forked from Peter Procházka’s Sitecore 9.1 branch

https://github.com/chorpo/Sitecore.Algolia/tree/sitecore91

  • Upgraded the Sitecore NuGet packages to 10.2.1.

Sitecore-Algolia-Search-Provider-10-2-1-Upgrade-1.png

  • Algolia.Search NuGet package upgraded 6.12.1

Sitecore-Algolia-Search-Provider-10-2-1-Upgrade-4.png

Sitecore-Algolia-Search-Provider-10-2-1-Upgrade-2.png

  • Finally, able to build the solution successfully. 

Sitecore-Algolia-Search-Provider-10-2-1-Upgrade-3.png

  • After the build was successful, I shifted the module to the existing solution.
  • I didn’t get a chance to upgrade the unit test project. If you have upgraded, please let me know.

The module is checked into the following repository.

https://github.com/Madhumidha/Sitecore.Algolia/tree/Sitecore1021

The repo has all the instructions on how to set up and configuration details.

Hope this helps.

Happy Sitecoring!

 

0