To add a new format available in combo shown in the display options of a node (or a CCK field), would normally have to add some functions in a module.
custom_formatters module allows you to do so more simple. Requires
also installed cck and token. Steps
custom_formatters
Once installed, go to admin / build / formatters. There are some examples that can serve as a guide.
Choose Add new formatter to add a new format.
For this example:
Name: minuto_segundo
Tag: Minute: Second
Editor mode: Advanced Field
type (s): PHP
number_float: return sprintf ('% 02d:% 02d', $ element ['# item '] [' value '] / 60, $ element [' # item '] [' value ']% 60);
When choosing Editor mode: Advanced, you can use PHP. Otherwise it is HTML and tokens.
In this case, the format item value is in $ element ['# item'] ['value'].
can read the original article in Drupalab: Adding a format minutes: seconds
0 comments:
Post a Comment