Hmm actually, I am not sure it would be a great option. My thinking was, if you look at the response from hitting our API endpoint directly:
https://cdn.builder.io/api/v2/content/page?apiKey=e37b966ec695434bb21e97442a4a9f46&userAttributes.urlPath=%2Fparent-page&limit=1
..."blocks": [
{
"@type": "@builder.io/sdk:Element",
"@version": 2,
"id": "builder-54acb58f09f34d90a87bd6ecd97ebbe1",
"component": {
"name": "Symbol",
"options": {
"dataOnly": false,
**"inheritState": true,**
"renderToLiquid": false,
"symbol": {
"model": "symbol",
"entry": "66bf2bfb01374a6bb2700db01c182a1f",
"data": {
"textInput": "default input text",
"author": {
"@type": "@builder.io/core:Reference",
"id": "026dc09cf19b4546bdb21aee320261a0",
"model": "author"
}
}
}
}
You could theoretically use the write API to manually find all content with a symbol and add the inheritState: true
but given that symbols can be nested, etc it would be very difficult to accurately set up.
Instead, I actually think the best route might be to instead of inheriting state, add a locale
input to your Symbol entries themselves that is marked as Required
Then, whenever a user places a symbol on a page, they will be required to select the locale. Here, instead of setting a value, you can actually bind the locale to a locale value from the parent page’s state:
This requires a little more of a setup, but as long as you set it as a required field that should force authors to set those values and avoid any user errors.
Hopefully this makes sense, please try it out and see if that works for you!