Bridge.Companywide
Allows the user to access Companywide keys & values from inside a slide.
warning
This is a much less powerful way to access CMSVals, which you can instead do with Bridge.CMSVals which we recommend to use over the functionality here.
Related links:
.get(key, defaultValue)
Returns the saved value for a specific Companywide key.
| Parameter | Type | Description |
|---|---|---|
| key | String | The Companywide data key |
| defaultValue | Any | Value to return if the key is not found |
const value = Bridge.Companywide.get("my_key", "Default");
.getSlideValues()
Returns an array of the current slide's Companywide values with keys, status and other data.
Bridge.Companywide.getSlideValues();
Returns:
[
{
active: false,
changed: false,
data: { Object },
key: "companywide_editable_1",
mime: "text/plain",
value: "Edited text",
},
{
active: false,
changed: false,
data: { Object },
key: "companywide_editable_2",
mime: "text/plain",
value: "Edited text",
},
];
.getSlideKeys()
Returns an array of the current slide's Companywide keys.
Bridge.Companywide.getSlideKeys();
Returns:
["key_1", "key_2"...]
.getSlideKeysForArticle()
Similar to .getSlideKeys(), but returns the keys for the calling slide's article specifically, even if it is not the currently active slide.
const keys = Bridge.Companywide.getSlideKeysForArticle();
.getWithKeys(keys)
Returns an array of Companywide values that match the keys in the
keys array.
| Parameter | Type | Description |
|---|---|---|
| keys | Array | Array of keys for the values to retrieve |
Bridge.Companywide.getWithKeys(["key_1", "key_2"]);
Returns:
[
{
active: false,
changed: false,
data: { Object },
key: "key_1",
mime: "text/plain",
value: "Edited text 1",
},
{
active: false,
changed: false,
data: { Object },
key: "key_2",
mime: "text/plain",
value: "Edited text 2",
},
];
.getTextEditorOptions()
Returns the configuration options for the text editor if defined.
const options = Bridge.Companywide.getTextEditorOptions();