[ckan-dev] Template modification: where to add secondary content block?

John Brisbin john at boab.info
Sun Jun 8 13:58:34 UTC 2014


G'Day all,

We're very new to CKAN and the templating system, so apologies in 
advance for the obvious.

Following the documentation at:

http://docs.ckan.org/projects/ckanext-spatial/en/latest/spatial-search.html

We get to the stage of adding the spatial search widget.

First problem is making sure we have the right path to the templates. 
Ours is a build from source install and I don't have the concept of 
"projects". So this advice is mysterious:

----
To add the map widget to the to the sidebar of the search page, add this 
to the dataset search page template 
(myproj/ckanext/myproj/templates/package/search.html)
----

Fishing around a bit I see the search.html template at:

/usr/lib/ckan/default/src/ckan/ckan/templates/package/search.html

This should be the right file to modify? Assuming yes...

Next problem is to add the block given in the documentation. Where does 
this go?

I see the template already has a % block secondary_content % 
declaration, so I should just be able to add the spatial fragment into 
the existing contents.

But I get an error:

----
Template spatial/snippets/spatial_query.html cannot be found
----

This makes me think that maybe I'm not in the right template area, or 
have somehow not got the extension installed quite right. I tried 
manually shoving the spatial snippets into the same directory as 
search.html, changed the path in the block include statement, and still 
got a "can't find the snippet" error.

Is this making enough sense to provide any guidance?

Thanks indeed,

JB

-- 
John Brisbin
Managing Director, BoaB interactive Pty Ltd
POB 248, MT Molloy QLD 4871

E: john at boab.info
M: 0407 471 565 | P: 07 4094 2172
Skype: boabjohn | Twitter: @boabjohn




More information about the ckan-dev mailing list