This module adds a button field type that can trigger custom actions when clicked, such as displaying messages or redirecting the page. It offers HTML and image button widgets and integrates with the Rules module to allow for flexible automation.
Adds a button field type for use with any fieldable entity type integrated with Rules. When the button is clicked, a Rules event is triggered allowing you to do actions such as display a message to the user, alter some data on the entity (or another entity) or reload the current (or any other) page. The module provides two different widgets: HTML Button and Image Button. It adds a new button click event, clicked button comparison, and reload page action for use with rules.
Drupal 9 port
This module is currently minimally-maintained.. If you are interested in becoming a co-maintainer, please create an issue in the issue queue.
Upgrading from Drupal 7
A field migration is provided to migrate any button fields from Drupal 7 to Drupal 8 or greater.
Differences from Drupal 7 version
- The "Button field reload" action has been removed, and you should use the Rules Core "Page redirect" action instead.
- AJAX button field redirects are not currently implemented.
Drupal 7 port
Upgrading from Drupal 6
This module provides no update path of its own from Drupal 6 to Drupal 7. To migrate your existing fields, take a look at Migrating D6 Content Construction Kit (CCK) to D7 Fields. To update your rules, read the "Upgrade from Rules 6.x-1.x to Rules 7.x-2.x" section of the README included in the Rules module. You must have Button Field alpha 2 or later installed in order to update your rules. Any button fields previously added to views will need to be re-attached to those views.
Important note
Due to #1452894: Elements with #has_garbage_value (image buttons) are always set as a triggering element you can not use image buttons on edit forms when there are any other buttons. Non-editable displays are unaffected.
Differences from Drupal 6 version
- Works with any fieldable entity
- Entity parameter provided with the rules event will contain any form values from the edit form
- Makes much better use of Drupal's Forms API (FAPI)
- Utilizes Drupal's Ajax Framework
Ask your assistant about Button Field
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 2.0.0-alpha2 | Pre-release | 9–10 | Jan 10, 2024 |