Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Project information
- Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed. - Maintenance fixes only
Considered feature-complete by its maintainers. - Module categories: Developer Tools
- 4 sites report using this module
- Created by pk.vaish on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.