Res facta quae tamen fingi potuit (
pauamma) wrote in
dw_dev_training2010-09-01 09:39 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[site community profile]](https://www.dreamwidth.org/img/comm_staff.png)
Entry tags:
jQuery, need_res, and set_active_resource_group
Is there a Wiki page (or something) on using jQuery on DW? I'm confused on what the group option to need_res is for vs. set_active_resource_group. And I need that info so I can update the TTization page (http://wiki.dwscoalition.org/notes/Routing_and_Template_Toolkit)
no subject
The group option allows you to set the group for a particular set of files.
set_active_resource_group sets which of the groups should be active on the current page.
The distinction is useful in site schemes, for example, so that they can include the proper file depending on whether the page wants jquery or not.
no subject
no subject
[%- CALL dw.active_resource_group( "jquery" ) -%]
[% dw.need_res( { group => 'jquery', optimize => 1 },
"js/jquery/jquery.ui.core.js",
"js/jquery/jquery.ui.widget.js",
"js/jquery/jquery.ui.mouse.js",
"js/jquery/jquery.ui.position.js",
"js/jquery/jquery.ui.draggable.js",
"js/jquery/jquery.ui.droppable.js",
"js/jquery/jquery.ui.selectable.js",
"js/jquery/jquery.ui.sortable.js",
"js/jquery/jquery.ui.datepicker.js",
"js/jquery/jquery.ui.dialog.js",
"js/jquery/jquery.ui.autocomplete.js" ) %]
[% dw.need_res(
"stc/jquery/jquery.ui.base.css",
"stc/jquery/jquery.ui.core.css",
"stc/jquery/jquery.ui.autocomplete.css",
"stc/jquery/jquery.ui.datepicker.css",
"stc/jquery/jquery.ui.dialog.css",
"stc/jquery/jquery.ui.selectable.css"
) %]
(which is from my tt-ization of the posts page)
no subject
no subject