function text_field_formatter_info

Implements hook_field_formatter_info().

File

modules/field/modules/text/text.module, line 181

Code

function text_field_formatter_info() {
    return array(
        'text_default' => array(
            'label' => t('Default'),
            'field types' => array(
                'text',
                'text_long',
                'text_with_summary',
            ),
        ),
        'text_plain' => array(
            'label' => t('Plain text'),
            'field types' => array(
                'text',
                'text_long',
                'text_with_summary',
            ),
        ),
        // The text_trimmed formatter displays the trimmed version of the
        // full element of the field. It is intended to be used with text
        // and text_long fields. It also works with text_with_summary
        // fields though the text_summary_or_trimmed formatter makes more
        // sense for that field type.
'text_trimmed' => array(
            'label' => t('Trimmed'),
            'field types' => array(
                'text',
                'text_long',
                'text_with_summary',
            ),
            'settings' => array(
                'trim_length' => 600,
            ),
        ),
        // The 'summary or trimmed' field formatter for text_with_summary
        // fields displays returns the summary element of the field or, if
        // the summary is empty, the trimmed version of the full element
        // of the field.
'text_summary_or_trimmed' => array(
            'label' => t('Summary or trimmed'),
            'field types' => array(
                'text_with_summary',
            ),
            'settings' => array(
                'trim_length' => 600,
            ),
        ),
    );
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.