pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
Res facta quae tamen fingi potuit ([personal profile] pauamma) wrote in [site community profile] dw_dev_training2010-09-01 09:39 pm
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)
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)

[personal profile] afuna 2010-09-02 05:03 pm (UTC)(link)
Yes! You can combine multiple files into one need_res, too, so, something like:

[%- 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)
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)

[personal profile] afuna 2010-09-02 05:04 pm (UTC)(link)
Oh, the CALL is important because for some reason, active_resource_group returns the value? And it gets printed out.