Field Formatter Template
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
Description
--------------------------
Field Formatter Template (FFT) allow you can easy create formatter template for any field.
Installation
--------------------------
1. Copy the entire fft directory the Drupal sites/all/modules
directory or use Drush with drush dl fft.
2. Login as an administrator. Enable the module on the Modules page.
Usage
--------------------------
- Create your template, default formatter template store in folder
'sites/all/formatter', you can change this folder at 'admin/config/content/fft'.
Formatter template create as normal tpl template, example you create inline tags template, create file with name 'fft-inline-tags.tpl.php' in folder 'sites/all/formatter'
open file and type:
<?php
/*Template Name: Inline Tags*/
// dpm($data);
$tags = array();
foreach ($data as $key => $item) {
$tags[] = l($item['name'], "taxonomy/term/" . $item['tid']);
}
print implode(" | ", $tags);
?>
Now open "Manage Display" of a content type, chose any field and chose
"Formatter Template" you can config and select "Inline Tags". Your field
formatter will display with 'fft-inline-tags.tpl.php'. Variables you can use in
template is $data and $entity
- $data: stored all data of selected field.
- $entity: attached entity of field.
- $settings: settings extras for template.
Example templates
--------------------------
Inline Taxonomy Term: display inline taxonomy term for Term reference field.
Slideshow FlexSlider: display image as slideshow with FlexSlider.
Thumbnail Slideshow FlexSlider: display image as thumbnail slideshow with FlexSlider.
CarouFredSel: display slideshow with CarouFredSel.
Owl Carousel: Slideshow with Owl Carousel.
Video
--------------------------
Video intro how to use FFT: https://www.youtube.com/watch?v=kF-Sa86VEtM
Video create FlexSlider formatter with FFT: https://www.youtube.com/watch?v=Yn2373Qftfg
