Button Field
The Button Field module provides a CCK button field that can be added to any content type. The field type can be used to fire rules through AJAX and redirect to another page. Two widgets are supplied with this module for the button field type: HTML Button and Image Button.
Dependencies
The Button Field module depends on two other modules:
Field Type
The button field type does not store any data. This module will not add any columns to the database for the content type(s) that a button field is added to. To add a button field to a content type, just follow the normal steps for adding a new Field.
Rules
The Button Field module provides both a new event and a new condition for the Rules module.
When the button is clicked and AJAX call is made back to the site. This call is fire the button_field_clicked event. This event passes two arguments. The first is argument is the field name as a string. The second argument is the node that the button appeared on.
This module provides the "Button is" condition. This condition requires a single string argument: the button name. This field should be the field name of the button (ie. field_button).
Widgets
There are two widgets available for button Fields: HTML Button and Image Button. The only common field for this field type is the URL. This is an optional field that will be used to redirect the page after the AJAX call completes. To simply reload the current page, enter <current> for the value.
HTML Button
The HTML Button widget displays a button field as a standard HTML button. The only additional value for this widget is the the button text, which defaults the field's label.
Image Button
The Image Button widget displays a button field as an image that acts the same as a button. This widget provides three additional fields. The Image path field is used for the src attribute of the image tag. The Alt text field is used for the alt attribute of the image and defaults to the field's label. The Title text field is used for the title attribute of the image and defaults to the field's label.
Todos
The remaining items still need to be visited before a stable release:
- Change the "Image path" field to use a file input type instead of text.
Find a better way to pass and use the field name as an argument in the Rules integration. Perhaps we can just rely on the post in the AJAX call instead of an argument.See if we can use rules for page redirection, allowing for the redirection to be more dynamic.


