Controls
Here are the available control types.
- Align
- Color
- Date
- Dimension
- Gallery
- Gradient
- Image
- Number
- Post Query
- Rich text editor
- Select
- Switch
- Text
- Select2
Control types
Align
<Control type="align" name="align_control_name" label="Align" default="right" />
- Attributes
default
- (optional) Accepted value:right
,center
,left
- Context
template
style
script
Color
<Control type="color" name="color_control_name" label="Color control" default="#FFFFFF" />
- Attributes
alpha
- (optional) If opacity is enable - defaulttrue
default
- (optional) Accepted value:rgb()
,rgba()
,hex
- Context
template
style
script
Date
<Control type="date" name="date_control_name" label="Date" format="Y-m-d H:i:s" />
- Attributes
format
- (optional) Date format - defaultd/m/Y
- Context
template
style
script
Dimension
<Control type="dimension" name="dimension_control_name" label="Dimension control">
<Key units>px,vh,vw</Key>
<Key default_unit>px</Key>
</Control>
- Attributes
default
- (optional) Default value - default0,0,0,0
(default="0"
ifmultiple_values
isfalse
)units
- (optional) Accepted units - defaultpx
default_unit
- (optional) Default unit - defaultpx
multiple_values
- (optional) Enter 1 or 4 values - defaulttrue
- Subvalues
top
- Top valueright
- Right valuebottom
- Bottom valueleft
- Left valueunit
- Unit used
- Context
template
style
script
Gallery
<Control type="gallery" name="gallery_control_name" label="Gallery control" size="full" />
- Attributes
default
- (optional) Attachment ID(s)size
- (optional) Size of the images - defaultfull
- Subvalues
ids
- Attachment ids
- Context
template
style
script
Gradient
<Control type="gradient" name="gradient_control_name" label="Gradient control" />
- Context
template
style
script
Image
<Control type="image" name="image_control_name" label="Image control">
<Key default>https://ps.w.org/tangible-loops-and-logic/assets/banner-1544x500.jpg</Key>
</Control>
- Attributes
default
- (optional) Accepted value:url
,attachment id
- Subvalues
id
- Get attachment idtitle
- Get attachment titlealt
- Get attachment altcaption
- Get attachment captiondescription
- Get attachment description
- Context:
template
style
script
Number
<Control type="number" name="number_control_name" label="Number control" min="0" max="100">
<Key default>50</Key>
</Control>
- Attributes
min
- (optional) Minimum value. Example : if min equal 0, so your number can't be less than 0.max
- (optional) Maximum value. Example : if max equal 100, so your number can't be better than 100.
- Context
template
style
script
Post Query
<Control type="post_query" name="post_query_control_name" label="Post query control" include_fields="taxonomy, type, order, orderby" />
- Attributes
include_fields
- (optional) Fields displayed for query options - defaulttype, order, orderby
- Context
template
style
script
Rich text editor
<Control type="editor" name="editor_control_name" label="Rich text editor control">
<Key default>Some <strong>text</strong></Key>
</Control>
- Attributes
default
- (optional) Accepted value:html
- Context
template
Select
<Control type="select" name="select_control_name" label="Select control" default="one">
<Map options>
<Key one>Option one</Key>
<Key two>Option two</Key>
<Key three>Option three</Key>
</Map>
</Control>
- Attributes
options
- (required) Value and label of the optionsmultiple
- (optional) If the control allows mutiple values - defaultfalse
- Context
template
style
script
Switch
<Control type="switch" name="switch_control_name" label="Switch control">
<Key value_on>on</Key>
<Key label_on>On</Key>
<Key value_off>off</Key>
<Key label_off>Off</Key>
</Control>
In Beaver Builder, a switch control will be displayed as a select.
- Attributes
value_on
- (optional) Value returned when switch enabled - defaulton
value_off
- (optional) Value returned when switch disabled - defaultoff
label_on
- (optional) Text displayed in the builder when switch enabled - defaultnone
label_off
- (optional) Text displayed in the builder when switch disabled - defaultnone
- Context
template
style
script
Text
<Control type="text" name="text_control_name" label="Text control" default="default text" />
- Context
template
style
script
- In scripts, text will be outputed with quotes
Select2
<Control type="select2" name="select2_control_name" label="Select2" />
- Attributes
multiple
- (optional) Select multiple value - defaultfalse
options
- (optional) Options display in the select - defaultnone
- Context
template
style
script