[ckan-dev] Theming: Improving widgetization and ability to enhance from outside core

Rufus Pollock rufus.pollock at okfn.org
Thu Mar 22 10:53:34 UTC 2012


We want to make it easier to theme and especially to extend themes.
Our current approach using transformation of the genshi streams
objects:

Problem:

* We want to remove the Transformer usage due to performance and its
close tie to genshi

* Want a standard way for core code and extensions to put code into
the templates where *templates request it* (templates control
insertion rather than extensions ...)

* Stacking versus overwriting on entry points
    * Relationship to h.requires('jquery', version) -
http://codex.wordpress.org/Function_Reference/wp_enqueue_script

Options: two main ones placeholders or helper methods (which are
essentially equivalent)

* Placeholders: {{user _info}} {{sub_menu}} is this equivalent to
<span class="insert-user-info"></span>

    * Equivalent to helper method via: {{xyz arguments}} ->
h.load_snippet('xyz', arguments)

* ${h.load_snippet()}

Proposal: move to h.load_snippet model with a dedicated extension
point for extensions to define 'snippets'.

Rufus




More information about the ckan-dev mailing list