"Dictionary" CMS Field Type

I often need the ability to create a list of properties for a CMS item. Say you have a Point of interest. You would like to list a set of its features, i.e. "Family-friendly", "Affordable", "Open 24/7", and style every item. The amount of features and their values may vary.

The simplest solution is to create a set of fields like "Feature 1", "Feature 2", "Feature 3" et cetera. This is viable, but you can only go so far with this, since then you would have to hide every unset value manually with Conditionaly visibility.

Another solution is to create a separate CMS collection only for Features, and then bind this collection to the POI with Multi-reference field. You would have to create a CMS item for every new feature. Obviously, this solution is far from good, especially when we consider numeric values, i.e. distance.

What if you want to make a "property-value" list? Say you have a real estate object. You would like to give a list of places nearby and display the respective walking distance, like kindergarten: 20 min, cafe: 5 min, school: 30 min, subway station: 5 min etc.

You can't do that, unless you create like 30 different fields for every type of place, or use custom code.

______________________________________

The solution would be to introduce a new Field type for CMS Collections. It may be called Dictionary (as in Python). This field may have two states:
- values only (car, plane, boat)
- properties-values (car: $1k, plane: $20k, boat: $15k)

We would then be able to use the CMS Collection element to iterate through this property value, just like we do with Multi-image CMS field.

I am convinced that this field type has huge potential and would allow for so many new applications for CMS items.

  • Daniil Smetanin
  • Aug 14 2024