Sitecore EXM – Adjusting how personalization tokens are rendered

For a specific scenario i wanted to be able to pass HTML through a personalization token to be used from within an EXM email. Unfortunately (due to security) personalization tokens are HTML encoded and this behaviour isn’t configurable. The token replacement is done from within the Sitecore.Modules.EmailCampaign.Core.Personalization.PersonalizationManager class, which is mostly static, private, and totally …

Sitecore Forms – Bypassing validation and overposting viewmodels

TLDR; Sitecore Forms is vulnerable for overposting which enables end-users to disable field validations. I’ve noticed that Sitecore Forms uses the default ASP.NET MVC model binding, and it binds the posted model to the FieldViewModel. As there is no validation on which properties of the FieldViewModel can be bound, we can post fields that should not …

Sitecore SXA/JSS – Invariant language versions and access denied exceptions

Within a new implementation running on Sitecore 10.1 with SXA, we ran into a problem where we saw Invariant Language versions being created on certain items or recieving access denied exceptions, when saving an item. After a long time i’ve managed to reproduce the issue and pinpoint it to a new handler that was introduced …

Sitecore CLI – Non-interactive login fails when having requiresUniqueEmail set to true

With the Sitecore CLI you can choose to login in with a non-interactive login, meaning that you specify a ClientId and ClientSecret, which is then used to log in. Interactive login means that you log in using a username and password, for a pre-existing user. Today a user on Slack had some issues using the …

Sitecore SXA – Sort by title does not work

Please note that my suggested solution isn’t specific for SXA. You can use this without SXA, as it introduces a new computed field. The SXA Sort Results component lets you sort your search results based on the Sortings that you define within /sitecore/content/Your Tenant/Your Site/Data/Search/Sort Results.This functionality will make use of the default Solr sorting, …

Sitecore – Hide the primary language from a multilingual site.

For one of our projects, we have a multilingual site, which contains content in Dutch and in English. To make sure that the language of the site isn’t determined just based on a cookie value, we’ve set LanguageEmbedding to Always on our LinkManager. By default, this will lead to the following:https://www.testdomain.com/nl-NL/mypagehttps://www.testdomain.com/en/mypage Looks great doesn’t it? …