[ckan-dev] Extending template extensions

Ian Ward ian at excess.org
Mon Mar 7 15:26:48 UTC 2016


You've got a couple options. The simplest is to create a template
named scheming/package/resource_read.html that uses {% ckan_extends %}
and override the blocks you need. This template must be in a template
directory added from a plugin that appears *before* scheming in the
plugin lists or it won't affect anything.

Another option is to subclass the SchemingDatasetsPlugin class, use
your subclass plugin instead of scheming, and override the
resource_template method to point to your new template. I'd only
recommend this option if you need to change something else about the
way the scheming internals work.

Ian

On Fri, Mar 4, 2016 at 4:41 PM, Harald von Waldow
<harald.vonwaldow at eawag.ch> wrote:
> Hi,
>
> I wonder whether it is possible to extend a template extension that
> extends the original template not with
> {% ckan_extends %}
> but rather with
> {% extends 'filename' %}.
>
> In particular, I want to modify, in my own extension, the template
> "scheming/package/resource_read.html" from ckanext-scheming, which
> starts with
> {% extends "package/resource_read.html" %}.
>
> I played with different places, e.g.,
> scheming/package/resource_read.html and
> package/resource_read.html
>
> and with different extend-statements, e.g.,
> {% ckan_extends %},
> {% extends "scheming/package/resource_read.html" %}
>
> but to no avail.
>
> Thanks,
> Harald
>
> --
> Harald von Waldow
> Eawag
> ICT Services
> Ueberlandstrasse 133
> 8600 Duebendorf
> http://www.eawag.ch
>
>
> _______________________________________________
> 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
>



More information about the ckan-dev mailing list