[ckan-dev] Cleaner extensions

Sean Hammond sean.hammond at okfn.org
Tue Apr 17 08:58:47 UTC 2012


> I'd like to move more content into snippets so that they are easier to
> override examples would include things like pagiation(), activity_div() in
> lib/helpers.py and much of the stuff in _util.html (function stubs would
> remain for backwards compatibility) and also stuff currently in
> layout_base.html like main menu, language chooser etc

This seems like quite a good idea to me. I can imagine use cases, like
someone wants to override how the activity streams or the facets or the
sidebar etc. look or work and they want this to apply wherever these
objects appear on the site. Makes sense. As long as it's perfectly
obvious what's going on, from looking at the template code

> 
> I'd also move all page content into a separate include file that defines
> the general page layout that can then be changed without affecting the base
> page

I don't understand this. You'll move page content into a file that
defines page layout?

> 
> Also from what I can tell extensions cannot add their own template
> directories and this has to be done in the main ckan.ini file I'm not sure
> if this is good or bad

Extensions can set config variables, examples here:

https://github.com/dadosgovbr/ckanext-dadosgovbr/blob/master/ckanext/dadosgovbr/plugin.py#L32-36

> It would be good to know what other issues people are aware of

I know we have ckanext-example, but I think ckan could benefit from
having a larger collection of simple self-contained example extensions,
showing what can be done and demonstrating best practice. At the moment
users are largely making it up as they go along and I don't think they
have much idea about how to do a, b or c, never mind the best way to do
it.




More information about the ckan-dev mailing list