Default Configurations
Last updated
Last updated
Before diving into the ways of setting default configurations there are a few things that need some introduction.
In the Template Editor elements that are not an atomic level elements (e.g. a material or a mesh) have IDs. See the area circled in red below.
These IDs are generated automatically but they can also be set/changed by you. Whenever there is a need to use IDs it is always recommended to change them to a human readable format.
This is also the case when you want to control default configurations through the API because these IDs have to be set through the API.
Here is an example of a code where default configurations of a product is set.
We will only show the link that is used in the configurator and not the complete **iframe **code so that it is easier to read.
This might look a bit complicated at first, so lets break it down step by step. You will notice that the URL parts are separated with &
symbols, and there are two types of elements in the URL above.
This is responsible for the viewer where a specific light settings (which you should be familiar with from the previous articles in the documentation) are used and our product is added.
These are the ones that set a specific configuration to selected default. You will see a strange character combination: %2F
. Whenever you see those just think of them as /
Using slash in the URL has a special meaning so it is recommended to use these special characters instead of the slash. We read the above text inside the param
as combined/category=taps
So to take the above scene as an example you will see that inside this scene the product is called combined
and the template that is used inside is Combined (Omika)
.
Let's say we want to set the default category of the above product. To be able to set a specific configuration we have to set the path in the template using the IDs. So in this specific case the path will be combined/category
.
Explanation: the ID of the main product is combined
and the config group inside has an ID called category
. See screenshot below.
Once you have identified the path to the configuration group and added it to the param part of the URL like so:
you will also need to set it to a specific Configuration Variant, which in this case will be Taps, see screenshot below.
and that is how we arrive to the final segment of our URL: