Download & Extend

jQuery tmpl library

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:

<?php
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

Downloads

Version Downloads Date Links
7.x-1.1 tar.gz (10.88 KB) | zip (11.55 KB) 2011-Dec-05 Notes

Project Information


Maintainers for jQuery tmpl library

  • richthegeek - 2 commits
    last: 24 weeks ago, first: 33 weeks ago

Issues for jQuery tmpl library

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports