Token filter does not show image field with FlexSlider formatter I want to display a gallery with the FlexSlider formatter in a Body field.

I installed the Token and Token filter modules and enabled "token filter" in text formats (admin/config/content/formats).

On my content type (admin/structure/types/manage/[content_type]/display) I enabled the "Token" display mode in "Extended display parameters".

For the Token display mode (admin/structure/types/manage/[content_type]/display/token) I set the FlexSlider formatter for my image field (field_gallery).

I added a node with the [node:field_gallery] token in the Body field but the token is being replaced with nothing.

How can I make an image field using the flex slider field formatter work with the token filter module?
My solution.

Install custom_formatters module.

Create a view with FlexSlider formatter:

    $view = new view();
    $view-&gt;name = 'field_slider';
    $view-&gt;description = '';
    $view-&gt;tag = 'default';
    $view-&gt;base_table = 'node';
    $view-&gt;human_name = 'Slider';
    $view-&gt;core = 7;
    $view-&gt;api_version = '3.0';
    $view-&gt;disabled = FALSE; /* Edit this to true to make a default view disabled initially */

    /* Display: Master */
    $handler = $view-&gt;new_display('default', 'Master', 'default');
    $handler-&gt;display-&gt;display_options['use_more_always'] = FALSE;
    $handler-&gt;display-&gt;display_options['use_more_text'] = 'more';
    $handler-&gt;display-&gt;display_options['access']['type'] = 'perm';
    $handler-&gt;display-&gt;display_options['cache']['type'] = 'none';
    $handler-&gt;display-&gt;display_options['query']['type'] = 'views_query';
    $handler-&gt;display-&gt;display_options['exposed_form']['type'] = 'basic';
    $handler-&gt;display-&gt;display_options['exposed_form']['options']['submit_button'] = 'Apply';
    $handler-&gt;display-&gt;display_options['exposed_form']['options']['reset_button_label'] = 'Reset';
    $handler-&gt;display-&gt;display_options['exposed_form']['options']['exposed_sorts_label'] = 'Sort by';
    $handler-&gt;display-&gt;display_options['exposed_form']['options']['sort_asc_label'] = 'Asc';
    $handler-&gt;display-&gt;display_options['exposed_form']['options']['sort_desc_label'] = 'Desc';
    $handler-&gt;display-&gt;display_options['pager']['type'] = 'full';
    $handler-&gt;display-&gt;display_options['pager']['options']['expose']['items_per_page_label'] = 'Elements';
    $handler-&gt;display-&gt;display_options['pager']['options']['expose']['items_per_page_options_all_label'] = '- All -';
    $handler-&gt;display-&gt;display_options['pager']['options']['expose']['offset_label'] = 'Skip';
    $handler-&gt;display-&gt;display_options['pager']['options']['tags']['first'] = '« first';
    $handler-&gt;display-&gt;display_options['pager']['options']['tags']['previous'] = '‹ prev';
    $handler-&gt;display-&gt;display_options['pager']['options']['tags']['next'] = 'next›';
    $handler-&gt;display-&gt;display_options['pager']['options']['tags']['last'] = 'last»';
    $handler-&gt;display-&gt;display_options['style_plugin'] = 'flexslider';
    $handler-&gt;display-&gt;display_options['style_options']['optionset'] = 'gallery_in_text';
    $handler-&gt;display-&gt;display_options['row_plugin'] = 'fields';
    /*  */
    $handler-&gt;display-&gt;display_options['fields']['field_gal']['id'] = 'field_gal';
    $handler-&gt;display-&gt;display_options['fields']['field_gal']['table'] = 'field_data_field_gal';
    $handler-&gt;display-&gt;display_options['fields']['field_gal']['field'] = 'field_gal';
    $handler-&gt;display-&gt;display_options['fields']['field_gal']['label'] = '';
    $handler-&gt;display-&gt;display_options['fields']['field_gal']['element_label_colon'] = FALSE;
    $handler-&gt;display-&gt;display_options['fields']['field_gal']['click_sort_column'] = 'fid';
    $handler-&gt;display-&gt;display_options['fields']['field_gal']['settings'] = array(
      'image_style' =&gt; '',
      'image_link' =&gt; '',
    );
    $handler-&gt;display-&gt;display_options['fields']['field_gal']['group_rows'] = FALSE;
    $handler-&gt;display-&gt;display_options['fields']['field_gal']['delta_offset'] = '0';
    /*  */
    $handler-&gt;display-&gt;display_options['sorts']['created']['id'] = 'created';
    $handler-&gt;display-&gt;display_options['sorts']['created']['table'] = 'node';
    $handler-&gt;display-&gt;display_options['sorts']['created']['field'] = 'created';
    $handler-&gt;display-&gt;display_options['sorts']['created']['order'] = 'DESC';
    /*  */
    $handler-&gt;display-&gt;display_options['arguments']['nid']['id'] = 'nid';
    $handler-&gt;display-&gt;display_options['arguments']['nid']['table'] = 'node';
    $handler-&gt;display-&gt;display_options['arguments']['nid']['field'] = 'nid';
    $handler-&gt;display-&gt;display_options['arguments']['nid']['default_action'] = 'not found';
    $handler-&gt;display-&gt;display_options['arguments']['nid']['exception']['title'] = 'All';
    $handler-&gt;display-&gt;display_options['arguments']['nid']['default_argument_type'] = 'fixed';
    $handler-&gt;display-&gt;display_options['arguments']['nid']['summary']['number_of_records'] = '0';
    $handler-&gt;display-&gt;display_options['arguments']['nid']['summary']['format'] = 'default_summary';
    $handler-&gt;display-&gt;display_options['arguments']['nid']['summary_options']['items_per_page'] = '25';
    /*  */
    $handler-&gt;display-&gt;display_options['filters']['status']['id'] = 'status';
    $handler-&gt;display-&gt;display_options['filters']['status']['table'] = 'node';
    $handler-&gt;display-&gt;display_options['filters']['status']['field'] = 'status';
    $handler-&gt;display-&gt;display_options['filters']['status']['value'] = 1;
    $handler-&gt;display-&gt;display_options['filters']['status']['group'] = 1;
    $handler-&gt;display-&gt;display_options['filters']['status']['expose']['operator'] = FALSE;
    /*  */
    $handler-&gt;display-&gt;display_options['filters']['type']['id'] = 'type';
    $handler-&gt;display-&gt;display_options['filters']['type']['table'] = 'node';
    $handler-&gt;display-&gt;display_options['filters']['type']['field'] = 'type';
    $handler-&gt;display-&gt;display_options['filters']['type']['value'] = array(
      'page' =&gt; 'page',
    );


Go to the custom formatters settings, create new formatter for Image field:
Format: PHP
Field types: Image
Formetter (php):

  print views_embed_view('field_slider','default', $variables['#object']-&gt;nid);


Or import this:

    $formatter = new stdClass();
    $formatter-&gt;disabled = FALSE; /* Edit this to true to make a default formatter disabled initially */
    $formatter-&gt;api_version = 2;
    $formatter-&gt;name = 'gallery_views';
    $formatter-&gt;label = 'Gallery views';
    $formatter-&gt;description = '';
    $formatter-&gt;mode = 'php';
    $formatter-&gt;field_types = 'image';
    $formatter-&gt;code = 'print views_embed_view(\'field_slider\',\'default\', $variables[\'#object\']-&gt;nid);';
    $formatter-&gt;fapi = '';


Then go to the Token tab (admin/structure/types/manage/[your_content_type]/display/token), set the Gallery views formatter. Now it works.