Advertising sustains the DA. Ads are hidden for members. Join today

Technical overview

Last updated on
30 April 2025

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.

Help improve this page

Page status: Not set

You can: