[ckan-dev] Cleaner extensions

Toby Dacre toby.okfn at gmail.com
Tue Apr 17 09:51:09 UTC 2012


On 17 April 2012 09:58, Sean Hammond <sean.hammond at okfn.org> wrote:

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

sorry not very clear - I mean that stuff the user sees should not be in the
'base' template so that the 'base' is used by all instances of ckan


>
> >
> > 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
>
>
yeah I found this now


> > 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.
>
>
yeah, the plugin documentation is getting better than it was but is still
not enough to actually get an extension up and running as
setup.py extension points must be defined and setup.py run to get these
working


> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120417/988097d7/attachment-0001.html>


More information about the ckan-dev mailing list