jQuery tmpl library

Component ID

1302660

Component name

jQuery tmpl library

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

1071

Component created

Component changed

Component body

This module does nothing by itself, use it as a helper for UI-heavy projects

This module adds the jQuery Templates library to Drupal as well as a helper function for adding templates from a file/string.

Example:

jquery_tmpl_add_template('my_template', 'templates/my_template.tpl.php');
jquery_tmpl_add_template('header', '<h${level}>${text}</h${level}>', TRUE);
$.tmpl('my_template', some_data).appendTo('#foo');
$.tmpl('header', {level:1, text: 'Baaaaa'}).appendTo('#page-title');

Whenever a template is added to the page the library is included, although you can also include manually as a library:

drupal_add_library('jquery_tmpl', 'jquery-tmpl');
// or
jquery_tmpl_include_library()

For a complete description of the jquery_tmpl_add_template function please see the comment block in the jquery_tmpl.module file.

Requirements: jquery_update