[ckan-dev] Exclude CKAN JS resources

Kirstein, Fabian fabian.kirstein at fokus.fraunhofer.de
Mon May 19 06:54:44 UTC 2014


Hi everybody,

I don’t want to bother you, but I really need a solution for my resource problem. Isn’t there any way to create an entirely independent theme for CKAN without the JS and CSS resources provided by CKAN?

Thank you so much!
Fabian


Von: ckan-dev [mailto:ckan-dev-bounces at lists.okfn.org] Im Auftrag von Kirstein, Fabian
Gesendet: Freitag, 9. Mai 2014 09:12
An: CKAN Development Discussions
Betreff: Re: [ckan-dev] Exclude CKAN JS resources

Hi Vitor,

Thanks for your fast reply! But I think that’s not the solution. I’m not using the page.html at all. I have a custom base.html and all templates are derived from  this base.html. You can reproduce it the following way: You have an extension with a custom route, custom controller, some resources and a HTML file, returned by the controller. As soon as you use the {% resource %} directive in your HTML all the resources from CKAN are included. I tried to overwrite the page.html anyway, but it doesn’t help. So something else must include those resources.

I would appreciate any further tip1
Thanks.
Fabian



Von: ckan-dev [mailto:ckan-dev-bounces at lists.okfn.org] Im Auftrag von Vitor Baptista
Gesendet: Donnerstag, 8. Mai 2014 17:23
An: CKAN Development Discussions
Betreff: Re: [ckan-dev] Exclude CKAN JS resources

Hi Ross,

As far as I can see, the problem isn't creating the resources, but loading them. It's done at https://github.com/ckan/ckan/blob/master/ckan/templates/page.html#L132-L139. So, if you overwrite that block in your template, you should be fine.

Keep in mind that many plugins depend on that resource, so they'll end up loading it.

Cheers,

2014-05-08 12:02 GMT-03:00 Ross Thompson <ross.thompson.ca at gmail.com<mailto:ross.thompson.ca at gmail.com>>:
I have found that in the ckan/lib/fanstatic_resources.py module in CKAN core that four fanstatic libraries are always created - regardless of any theming work you may be doing.

For our work with our very custom theme library which requires making jquery 2.1 and 1,11 available, I have not yet found an alternative to patching this module to get rid of the calls to create_library() at the bottom of the module in order to prevent CKAN from loading the base resources.config.

If anyone has alternatives, I too would be interested.
Ross
Statistics Canada

On 8 May 2014 07:14, Kirstein, Fabian <fabian.kirstein at fokus.fraunhofer.de<mailto:fabian.kirstein at fokus.fraunhofer.de>> wrote:
Hello,

I’m developing a very custom CKAN theme within an extension, with own CSS and JavaScript. I have a custom base.html and derived templates from that. But CKAN is still including all its JavaScript etc., configured in public/base/javascript/resources.config. I don’t want any of those resources, they are causing some conflicts. Is there any way to prevent this behaviour within my extension?

Thanks a lot
Fabian.


----

Fabian Kirstein
Fraunhofer-Institut für Offene Kommunikationssysteme FOKUS
Kompetenzzentrum Electronic Government and Applications

Kaiserin-Augusta-Allee 31
10589 Berlin, Deutschland
Tel.  + 49 30 3463 7718<tel:%2B%2049%2030%203463%207718>
E-Mail: fabian.kirstein at fokus.fraunhofer.de<mailto:fabian.kirstein at fokus.fraunhofer.de>
Internet: www.fokus.fraunhofer.de<http://www.fokus.fraunhofer.de/>


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


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



--

Vítor Baptista

Developer  |  http://vitorbaptista.com | LinkedIn<http://www.linkedin.com/in/vitorbaptista> | @vitorbaptista<http://twitter.com/vitorbaptista>

The Open Knowledge Foundation<http://okfn.org>

Empowering through Open Knowledge

http://okfn.org/  |  @okfn<http://twitter.com/okfn>  |  OKF on Facebook<https://www.facebook.com/OKFNetwork>  |  Blog<http://blog.okfn.org/>  |  Newsletter<http://okfn.org/about/newsletter/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140519/704f9855/attachment-0003.html>


More information about the ckan-dev mailing list