Skip to main content

Text Suggestion

This control creates a text field with the option to append selectable data within the text field.

<Control type="text_suggestion" name="text_suggestion_name" label="Text suggestion control">
<Map choices>
<Key one>One</Key>
<Key two>Two</Key>
<Key three>Three</Key>
</Map>
</Control>

Attributes

  • default - Defines the default value of the control.
    Type: string
  • label - Defines the label of the control which will be displayed in the page builder.
    Type: string
  • name - Defines the name of the control which will be referenced to render the control value.
    Type: string

Rendering the control value

The value can be rendered in a template, style, or script.

In a template, use Get or Loop to render the control value.

<Get control=text_suggestion_name />

<Loop control=text_suggestion_name>
<Field value />
</Loop>

In a style, use the standard syntax to refer to SASS variables.

.style {
color: #{$text_suggestion_name};
}

In a script, use the standard syntax to refer to JS variables.

console.log(text_suggestion_name);

Preview

In Gutenberg

In Elementor

In Beaver Builder