Remove Button
Supported products
- Central CMS
- Central Forms
- Central Connect
Used by other helpers to add consistenly styled button to indicate an object can be removed.
Basic usage
- Twig
- HTML
{{
html.remove_button({
'target': '#itemToRemove'
})
}}
<button data-tippy-content="Remove this item" data-tippy-placement="right" type="button" data-action="remove" data-action-target="#itemToRemove" class="btn remove-button"><i class="icon-remove-sign"><span class="hide">Remove</span></i></button>
Helper options
You can configure this helper using the common helper options, the following options are specific to this helper.
Option | Type | Description |
---|---|---|
target | string | Selector of the item to be removed, will be turned into the data-action-target attribute |
type | string | Type of button to create, can be button (default), link , input or submit |
JavaScript hooks
The following attributes are added to the button, you can use these in your own JavaScript methods when removing items.
data-action="remove" data-action-target="#itemToRemove"