You are here

function amp_field_formatter_info in Accelerated Mobile Pages (AMP) 7

Implements hook_field_formatter_info().

File

./amp.module, line 917

Code

function amp_field_formatter_info() {
  return array(
    'amp_text' => array(
      'label' => t('AMP text'),
      'description' => t('Display AMP text.'),
      'field types' => array(
        'text',
        'text_long',
        'text_with_summary',
      ),
    ),
    // The amp_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.
    'amp_text_trimmed' => array(
      'label' => t('AMP trimmed text'),
      'description' => t('Display AMP trimmed text.'),
      '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.
    'amp_text_summary_or_trimmed' => array(
      'label' => t('AMP summary or trimmed'),
      'description' => t('Display AMP summary or trimmed text.'),
      'field types' => array(
        'text_with_summary',
      ),
      'settings' => array(
        'trim_length' => 600,
      ),
    ),
    'amp_video' => array(
      'label' => t('AMP video'),
      'description' => t('Display an AMP video file.'),
      'field types' => array(
        'file',
      ),
      'settings' => array(
        'amp_video_height' => '175',
        'amp_video_width' => '350',
      ),
    ),
    'amp_image' => array(
      'label' => t('AMP image'),
      'description' => t('Display an AMP image file.'),
      'field types' => array(
        'image',
      ),
      'settings' => array(
        'image_style' => '',
        'image_link' => '',
        'amp_layout' => 'responsive',
        'amp_fixed_height' => '300',
      ),
    ),
    'amp_iframe' => array(
      'label' => t('AMP iframe'),
      'description' => t('Display amp-iframe content.'),
      'field types' => array(
        'text',
        'text_long',
        'text_with_summary',
      ),
    ),
  );
}