5

I'm trying to import multiple css resources in my own CKAN theme using Fanstatic like this:

{% resource 'my_fanstatic_library/b.css' %}
{% resource 'my_fanstatic_library/a.css' %}

Unfortunately CKAN renders them in alphabetical order:

<link rel="stylesheet" type="text/css" href="/fanstatic/mytheme/:version:2015-05-11T14:07:18/a.css" />
<link rel="stylesheet" type="text/css" href="/fanstatic/mytheme/:version:2015-05-11T14:07:18/b.css" />

To overwrite the order I tried to create a resource.config-file with the following content:

[main]

order = b.css a.css

[custom render order]

b.css = 1
a.css = 2

[depends]

a.css = b.css

But sadly there was no change in the rendering order. I placed the resource.config file in the mytheme/fanstatic/ folder and moved it to mytheme/ but nothing helped.

Florian Brucker
  • 9,621
  • 3
  • 48
  • 81
tschortsch
  • 118
  • 7

2 Answers2

0

order and custom render order both work for me, however depends just throws an error. Your resource.config file should be at mytheme/resource.config.

I need to restart the server after making changes to resource.config, however.

Which version of CKAN are you running and which server do yo use?

Florian Brucker
  • 9,621
  • 3
  • 48
  • 81
0

When creating resource config file make it inside fantastic folder. Annd syntax should be,

[main] order = css/b.css css/a.css

[depends] css/a.css = css/b.css

This is a good example: https://github.com/ckan/ckanext-pages/blob/master/ckanext/pages/theme/public/resource.config

Sameera K
  • 1,298
  • 1
  • 17
  • 26