Community Documentation

Technical overview

Last updated May 31, 2012. Created by jeff h on May 31, 2012.
Log in to edit this page.

Live Themer watches for the use of certain theme hooks when rendering a page (eg block, page, comment etc). When Drupal's theme engine renders one of these, Live Themer stores the render array (or, if not available, the variables array sent to the theme_hook() function in question), so it can later regenerate the same theme hook but with a different *.tpl.php file or theme function.

The Javascript UI allows a user to dynamically select from the variations available for each of these theme hooks, thereby allowing to assign specific *.tpl.php templates or alternative theme functions to specific objects on the page.

Further, variations may also (or only) contain css or javascript. If there is only a css or js change, the markup for the object is not regenerated; the css or js is dynamically added to the dom and a unique class is added to the object on the page.

The result of the configurations made through the Javascript interface is:

* a serialised array containing template suggestion information and variables which are fed as necessary into templates via a preprocess function. The theme layer is given this array thereby not requiring the Livethemer Inspector module to be active whilst simply using the theme.

* a CSS file which is dynamically generated by the module. This CSS file can be aggregated using Drupal's usual method.

About this page

Drupal version
Drupal 7.x
Audience
Designers/themers, Programmers, Site builders
Level
Intermediate, Advanced
Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.