Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Quan Mai
Mar 27, 2019
  3816
(6 votes)

New feature in Commerce 13.1: StringDictionary support for catalog content

When we introduced strongly typed content type support for catalog items in Commerce 7.5, some of the metafield types were left unsupported. One of them was StringDictionary. While it's not the most common metafield type, it is used by several customers and we get the questions about supporting it from time to time.

We have had to say no each time, until now!

Upcoming Commerce 13.1 will add support for StringDictionary metafield type for catalog content. If you already have a StringDictionary with name "StringDict" (yeah, it's a bad name, but let's be generic) in your FashionProduct metaclass, you can map it with a strongly typed property in your FashionProduct content type like this:

[BackingType(typeof(PropertyStringDictionary))]
 public virtual IDictionary<string, string> StringDict { get; set; }

BackingType attribute is required to indicate that the underlying metafield is StringDictionary. If you don't have a StringDict metafield of type StringDictionary already, Commerce will automatically create and assign it to the metaclass for you.

The support is at API level, we don't support editing StringDictionary property in Catalog UI yet, and it's unlikely to happen. However if you have code in your website that load MetaObjects to read the StringDictionary metafields, update them and save it back, you can now simply do it in an entirely "content way". Now you can load, delete and update the items in StringDict directly using content APIs as other property types.

Commerce 13.1 is a few weeks away from release. 

Mar 27, 2019

Comments

Praful Jangid
Praful Jangid Jun 23, 2019 05:23 PM

This sounds very useful. Will this be render as a property list or what?

Please login to comment.
Latest blogs
Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog