Custom Formatters
The Custom Formatters module allows users to easily create custom CCK/Field Formatters without the need to write a custom module. Custom Formatters can then be exported as CTools Exportables/Features or Drupal API Formatters.
Custom Formatters was written and is maintained by Stuart Clark (deciphered).
- http://stuar.tc/lark
- http://twitter.com/Decipher
Important note
Changes have been made to the PHP formatters Render Array integration to correctly support multi-field values, this changes the HTML wrappers of the formatter and may affect the theming of your site. This change will be made in 7.x-2.2 and the upcoming development releases.
Features:
- Two different editor modes:
- Basic/HTML + Tokens: A HTML based editor with Token support.
- Advanced/PHP: A PHP based editor with support for multiple fields and multiple values.
- Support for:
- CCK/Fields fields.
- [D6] CCK Fieldgroups.
- [D6] CCK 3.x Multigroups.
- [D6] Display suite fields.
- Views.
- Exportable as:
- Drupal API formatter
- CTools exportable/Features
- Live preview ([D6] requires Devel generate module).
- Integrates with:
- [D7] Coder Review module - Review your Custom Formatter code for Drupal coding standards and more
- [D7] Drupal Contextual links module - Adds a hover link for quick editing of Custom Formatters.
- Features module - Adds dependent Custom Formatters (from Views or Content types) to Feature.
- [D7] Form Builder - Drag'n'Drop interface for builder Formatter Settings forms.
- Insert module - Exposes Custom Formatters to the Insert module.
- Libraries API module and the EditArea javascript library - Adds real-time syntax highlighting.
Required Modules:
- [D7] Chaos tool suite
- [D6] Content Construction Kit (CCK)
- [D6] Token
Recommended Modules:
- [D7] Coder (includes Coder review)
- Devel (includes Devel generate)
- [D7] Form Builder
- Libraries API
- [D7] Token
Usage/Configuration:
Custom Formatters can be managed on the 'Custom Formatters' overview page.
Drupal 6:
'Administer > Site configuration > Custom Formatters'.
http://[www.yoursite.com/path/to/drupal]/admin/build/formatters
Drupal 7:
'Administration > Structure > Formatters'.
http://[www.yoursite.com/path/to/drupal]/admin/structure/formatters
EditArea - Real-time syntax highlighting
The EditArea javascript library adds real-time syntax highlighting, to install it follow these steps:
- Download and install the Libraries API module.
- Download the EditArea library and extract and move it into your libraries folder as 'editarea' (eg. sites/all/libraries/editarea).
CustomFormatters.com
CustomFormatters.com is a Custom Formatter repository, which in the future will cater for user contributed Formatters.
The website is open-source with the intent of community contributions to the site itself, to get involved you can visit github.com/Decipher/customformatters.com and checkout the source code, branch the project and play.
More information on usage, including tips & tricks, can be found in help:
http://[www.yoursite.com/path/to/drupal]/admin/help/custom_formatters