[ckan-dev] RFC snippets
Sean Hammond
sean.hammond at okfn.org
Fri Apr 13 11:27:53 UTC 2012
> The idea is to have a folder of snippets in templates that can then be
> rendered as needed via a helper function. This helps reduce the
> size/complexity of _util.html etc. It allows individual page components to
> be easily customised by extensions without duplicating content which
> remains identical.
>
> example:
>
> ${h.snippet('package_list', packages=packages)}
>
> This renders the template "snippets/package_list.html" passing {'packages'
> : packages} and inserts it into the page.
Seems like a great idea to me.
> Should we be more explicit in passing the full template name?
I think so, yes. It'd be good if I could look at a call to h.snippet and
see immediately which template file it was calling, without having to
know that 'package_list' maps to some file.
More information about the ckan-dev
mailing list