[ckan-dev] Extending template extensions

Harald von Waldow harald.vonwaldow at eawag.ch
Mon Mar 7 16:02:04 UTC 2016


Thanks a lot Ian!

The " *before* " - part was what tripped me up.

Cheers,
Harald

On 2016-03-07 16:26, Ian Ward wrote:
> 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
>>
> _______________________________________________
> 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
> 

-- 
Harald von Waldow
Eawag
ICT Services
Ueberlandstrasse 133
8600 Duebendorf
http://www.eawag.ch

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160307/eaccca6c/attachment-0003.sig>


More information about the ckan-dev mailing list