Posted by pk.vaish on October 7, 2011 at 3:50pm
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
Project Information
- Maintenance status: Minimally maintained
- Development status: Maintenance fixes only
- Module categories: Developer, JavaScript Utilities, Utility
- Reported installs: 64 sites currently report using this module. View usage statistics.
- Downloads: 166
- Last modified: January 5, 2012