close

Filter

loading table of contents...

Studio Developer Manual / Version 2304

Table Of Contents

9.13 Inheritance of Property Values

The CAE sometimes renders fallbacks if a content property is not set, for example, by using a value of another property instead. To visualize this in Studio, you may use content of a property editor from another property editor as the default empty text.

This is currently possible for a few property fields. One is the StringPropertyField and the other one is the TextAreaPropertyField. While the StringPropertyField may inherit its content from another StringPropertyField, the TextAreaPropertyField may inherit its content from a StringPropertyField or a RichTextPropertyField.

In order to use this visualization, you may use the StringPropertyFieldDelegationPlugin or the TextAreaPropertyFieldDelegationPlugin attached to the property field that should inherit the value.

import Config from "@jangaroo/runtime/Config";
import ConfigUtils from "@jangaroo/runtime/ConfigUtils";
import PropertyFieldGroup from "@coremedia/studio-client.main.editor-components/sdk/premular/PropertyFieldGroup";
import StringPropertyField from "@coremedia/studio-client.main.editor-components/sdk/premular/fields/StringPropertyField";
import StringPropertyFieldDelegatePlugin from "@coremedia/studio-client.main.editor-components/sdk/premular/fields/plugins/StringPropertyFieldDelegatePlugin";
import TextAreaPropertyField from "@coremedia/studio-client.main.editor-components/sdk/premular/fields/TextAreaPropertyField";
import TextAreaPropertyFieldDelegatePlugin from "@coremedia/studio-client.main.editor-components/sdk/premular/fields/plugins/TextAreaPropertyFieldDelegatePlugin";

//...
Config(PropertyFieldGroup, {
  title: "...",
  items: [
    Config(StringPropertyField, {
      itemId: "teaserTitle",
      propertyName: "teaserTitle",
      ...ConfigUtils.append({
        plugins: [
          Config(StringPropertyFieldDelegatePlugin, { delegatePropertyName: "title" }),
        ],
      }),
    }),
    Config(TextAreaPropertyField, {
      propertyName: "teaserText",
      ...ConfigUtils.append({
        plugins: [
          Config(TextAreaPropertyFieldDelegatePlugin, { delegatePropertyName: "detailText" }),
        ],
      }),
    }),
  ]
})

Example 9.40. Configuring Property Inheritance


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.