recentpopularlog in

therobyouknow : token   12

Custom Formatters | Drupal.org
great module for formatting output of fields, e.g. title link for downloadable file:

admin/structure/formatters/list/formatter_file_link_title/edit
$preMime = $variables['#object']->filemime;
$postMime = str_replace( "/", "-", $preMime );

$filePath = "/sites/default/files/".$variables['#object']->filename;
$fieldTitle = $variables['#object']->field_title['und'][0]['value'];

$output = "<img class=\"file-icon\" alt title=\"";
$output .= $postMime;
$output .= "\" ";
$output .= "src=\"/modules/file/icons/";
$output .= $postMime;
$output .= ".png\"/>";
$output .= "<a href=\"";
$output .= $filePath;
$output .= "\">".$fieldTitle."</a>";

echo $output;

use this here: file-types/manage/document/file-display
custom_formatters  module  contrib  computing  web  dev  drupal  cms  field  output  display  format  formatter  token  php  config  entity  node  content 
january 2014 by therobyouknow
Token Filter | drupal.org
not sure what this actually does - documentation is sparse!
token_filter  filter  token  module  drupal  computing  web  dev  cms 
july 2013 by therobyouknow

Copy this bookmark:





to read