This article details what template and property keys are. Learn about naming conventions and the rules we have in place for enforcing key uniqueness.
An introduction to keys
Keys are automatically created during the setup of Experience and Collection templates. They are generated when you name a template or property. To prevent breaking code generated by our Command-line interface (CLI), we enforce uniqueness by locking the key when the template or property is first updated and published. This is confirmed with a lock icon next to the key name.
Once this lock icon is shown, it is no longer possible to edit the key name. If you absolutely need to change the name, we suggest you delete this template or property and replace it with a new one. This should be done with care as it may impact other templates or Scenarios.
Experience and Collection template keys
Templates are used to mirror your platform hierarchy. They are configurable and create a visual representation of your product's components and elements. It's likely that you'll end up with multiple templates and properties, and each one will have its own unique key.
To prevent duplicate keys, we've implemented rules around naming conventions, and introduced validation messaging to inform you if a key collision will take place.
Sanitization rules and naming conventions:
-
Multiple underscore characters ‘_ _’ will auto-correct to a single underscore ‘_’.
-
Only lowercase alphanumeric characters and single underscores can be used.
-
Spaces ' ' in names will automatically convert to underscores '_'.
-
Only the ‘untitled’ part of the key is editable. The suffix ‘_experience’ or ‘_collection’ is added automatically.
-
Certain keywords like 'class, var, break, public, private, switch, new' are reserved and cannot be used in key names. See full list of reserved keywords here.
Property keys
Properties are used to configure Experience templates. A property key is generated when a property (text box, number field, tag element, etc.) is added and named and is editable until the page is updated. Inline error messaging and a passive notification will inform you if a key is already in use or invalid.
Sanitization rules and naming conventions:
-
Multiple underscore characters ‘_ _’ will auto-correct to a single underscore ‘_’.
-
Only lowercase alphanumeric characters and single underscores can be used.
-
Spaces ' ' in names will automatically convert to underscores '_'.
-
Certain keywords like 'class, var, break, public, private, switch, new' are reserved and cannot be used in key names. See full list of reserved keywords here.
Section keys
A section is a placeholder in a Collection template that can hold up to 20 Experiences. A section key is generated when a section is added to the Collection template and named. The key is editable until the page is updated. Inline error messaging and a passive notification will inform you if a key is already in use or invalid.
Sanitization rules and naming conventions:
-
Multiple underscore characters ‘_ _’ will auto-correct to a single underscore ‘_’.
-
Only lowercase alphanumeric characters and single underscores can be used.
-
Spaces ' ' in names will automatically convert to underscores '_'.
-
Certain keywords like ‘class, var, break, public, private, switch, new’ are reserved and cannot be used in key names. See full list of reserved keywords here.
What to read next?
Learn more about properties and their definitions or how to build an Experience template.