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

Vitor Baptista vitor at vitorbaptista.com
Sun Jun 8 20:34:36 UTC 2014


Hi John,

Please refer to the Theming Guide at
http://docs.ckan.org/en/latest/theming/index.html . The recommended way of
customizing a theme is to create a new extension and change anything you'd
like there, so you don't change CKAN core files, which will save you lots
of headaches down the road, when you want to upgrade CKAN. This "project"
that the spatial docs talk about is your custom extension.

You can see a few examples of extensions customizing the themes at
https://github.com/okfn/ckanext-mx and
https://github.com/okfn/ckanext-pakistan .

The specific docs on how to customize a block is in
http://docs.ckan.org/en/latest/theming/templates.html#replacing-template-blocks-with-block

Cheers,


2014-06-08 10:58 GMT-03:00 John Brisbin <john at boab.info>:

> 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
>
> _______________________________________________
> 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
>



-- 

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/20140608/5f4d3a40/attachment-0003.html>


More information about the ckan-dev mailing list