If you have defined Variants in your base structure, they will be accessible in Composer as properties of the interface asset for your Headless CMS base.
You can select a variation in the Properties panel or the X-Ray panel in Composer's Edit Mode. After saving your experience, this selection will become the default variation displayed when running the experience in a Player.
Enable users to select a variation
In addition to the Variant properties, the Headless CMS base will also come with some "Set variant" actions for dynamically selecting a new variation. You can call this action from any trigger, such as a Button "is released" or a Toggle Button "is checked" trigger.
In the example of a Multi-language experience, having toggle buttons showing which language is selected is a good practice.
When calling the "Set Variant" action, all the Intuiface assets bound to a base property with the assigned variant will automatically display their new value onscreen.
Advanced Tip: If you have a long list of variations and do not want to create all the buttons manually, you can create an additional collection in your H-CMS base, with a single Text property, that contains a list of your variations. You can then display this list using a collection such as an Asset Grid and bind the variation name to this text field. Make sure the content of that collection matches exactly the name of your variations!
Automatically select a variation
Using the System Information interface asset as an input, you can configure an experience to automatically choose a variation for a given property, either base on a Player ID, Player tag or any other available information.
See how to manage content using Player tags and replace the "Go to scene" action with a "Set variant" action.
You can add some specific settings in your H-CMS base to help the content editors decide which variation should be assigned to which Player. In the example below, we matched a Player Name (or Tag) with a default language.
On the content side, we then created a list for each Player device.
In Composer, you can then use a trigger when the experience is started to
- Filter this collection based on the Player Name first
- Then set the Language variant using a filter applied to the "Default Language" property