Alert
Static Alerts
This alerts are hardcoded with the content of the view xml
<alert alert_type="warning" title="Warning" text="This is a warning notice about copywriting." />
text
is a Required attribute.
In this case is a alert
with type warning
, types supported are:
- warning
- success
- info
- error
This is a warning notice about copywriting.
Detailed description and advice about successful copywriting.
Additional description and information about copywriting.
This is an error message about copywriting.
Add actions to alerts New
<alert alert_type="warning" title="Warning" text="This is a warning notice about copywriting."> <button string="Fix this issue" type="object" name="fix_issue" icon="thunderbolt" /> <button string="Ignore" type="object" name="ignore_issue" icon="audio-muted" /></alert>
Further details about the context of this alert.
Dynamic Alerts
v2.39.0You can also create dynamic alerts using the widget with a <field />
tag, this
field must be the type of json
and must have the following structure:
{ "alertType": "warning", "title": "Warning", "text": "This is a warning notice about copywriting."}
And with the following xml:
<field name="field_name" widget="alert" />
This is an error message about copywriting.
You can also add static and dynamic buttons to the dynamic alert with the following
json
and xml
:
{ "alertType": "warning", "title": "Warning", "text": "This is a warning notice about copywriting.", "buttons": [ { "string": "Ignore", "buttonType": "object", "name": "ignore_issue", "icon": "audio-muted" } ]}
You can see all the available attributes for the buttons in the button component.
The only different attribute is buttonType
which is the same as the type
attribute in the button component.
<field name="field_name" widget="alert"> <button string="Fix this issue" type="object" name="fix_issue" icon="thunderbolt" /></field>
Further details about the context of this alert.
API
Property | Description | Type | Default | Version |
---|---|---|---|---|
alert_type | Type of alert | "success" | "warning" | "info" | "error" | info | - |
title | Title of the alert | string | - | - |
text | Required. Description of the alert | string | - | - |
Can have children elements of type button.