[ckan-dev] Adding JS to a template

Hendrik Bunke h.bunke at zbw.eu
Wed Nov 23 09:17:45 UTC 2016


Hi Timothy,

try to put the {% resource ... %} inside the relevant {% block ... %} where you
actually use that resource.

regards
hendrik


--On 2016-11-22 15:19, Timothy Giles wrote:
> Hi all,
> 
> So, I am trying to add a 'tablesorter' to a template. To do this I have added the JS file to my fanstatic, added the relevant line in plugins to reference fanstatic, and added a {% resource '/sludcu/..... %} line in to the template as well as the code below.
> 
> $(document).ready(function()
>     {
>         $('#table').tablesorter();
> 
>     }
> );
> 
> 
> Problem is, it is not working and I dont understand why. Both jquery-latest.js and jquery.tablesorter.js are in the fanstatic folder, I am loading the resources at the top of the template file (as above).
> 
> 
> 
> Am I missing something really obvious!?
> 
> 
> 
> Thanks in advance for your time.
> 
> 
> 
> Timothy

> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev


-- 
Dr. Hendrik Bunke
ZBW - Leibniz Information Centre for Economics
--Innovative Information Systems and Publishing Technologies--
http://zbw.eu



More information about the ckan-dev mailing list