Custom Formatters 1.3 - Previews, API and more.
I'm happy to announce that Custom Formatters 1.3 is now available for download.
The primary changes this time around are:
See live previews of your formatters during creation.
Previews are available for both Basic and Advanced formatters, but requires you have the Devel Generate module installed and enabled. It also requires that the CCK field you are using has implemented Devel Generates hook_content_generate().
To make things even easier, when Devel Generate is enabled you can simply insert
dpm($element);at the top of an advanced formatter, hit preview, and you will be presented with the contents of the array.
Developers can now improve support between their modules CCK field and the Custom Formatters module.
A great example of the use of this API can be found in the current development build of the ImageField Extended module, allowing the use of the added ImageField fields via their tokens.
More information on the use of the API can be found in the DEVELOPERS.txt file included in the release.
Per request, I've added some much needed tokens to Custom Formatters to help with the creation of formatters:
- Path to the current theme
- Path to defined theme; path-to-theme-garland, etc.
- Path to defined module; path-to-module-custom_formatters, etc.
- Path to files directory.
- File ALT text.
- File Title text.
- File path to defined ImageCache preset; filefield-imagecache-thumb, etc.
While I was originally reluctant to include the tokens in this module, as I'm sure there would be a more appropriate home for them, the inclusion does allow for some great formatters to be created.
For more information and to download version 1.3, head over to the Custom Formatters project page.