Drupal 7 theming with Template Field Variables

Post on 18-Dec-2014

148 views 0 download

description

The Template Field Variables module is a utility module for themers. Its only purpose is to make Drupal template development less painful. It provides "dead-simple variables" rather than Drupal's infamous "massive nested arrays". In this presentation the module author will walk you through how to make your life easier as a themer.

transcript

Drupal 7 theming withTemplate Field Variables

Jeremy Epsteinhttp://greenash.net.au/

Drupal Camp Sydney, Blue Mountains29 Jun 2014

Template Field Variables:https://drupal.org/project/tpl_field_vars

Default Drupal 7 node.tpl.php

Fledgling Drupal themer

Image credit: http://oilersnation.com/2013/10/18/not-the-right-mix/page/1

Wants a byline in a blockquote

Gets this output

Hey, how about this kitten-killer

Image credit: http://wforweilun.blogspot.com.au/2010/01/kitten-killer-of-hangzhou.html

The Right Way™ - a field--field-byline.tpl.php

The Other Right Way™ - without having to override field.tpl.php

Image credit: http://www.deviantart.com/art/Twitter-Fail-Whale-Wallpaper-174820888

field--field-bla.tpl.php

Image credit: http://commons.wikimedia.org/wiki/File:SMirC-thumbsdown.svg

Image credit: http://techcrunch.com/2011/05/02/pandora-is-now-10-billion-thumbs-strong/

How to override node.tpl.phpNon rocket-scientists' edition