Override (monkey-patch?) template of external class

73 Views Asked by At

Having a fixed custom template in my local application, how can I set it to be used instead of using the original one defined in external add-on?

In my case is about this template: https://github.com/zopefoundation/zope.formlib/blob/master/src/zope/formlib/orderedSelectionList.pt

I tried adding it "orderedSelectionList.pt" in my skins folder, but it seems it is not used (because the original one is not in skins).

I tried also to monkey-patch the class and change the path with ViewPageTemplateFile('skins/my_folder_with_templates/orderedSelectionList.pt'). This part is really funny, I can't have it working.

Any suggestion in cases like this?

1

There are 1 best solutions below

3
cdw9 On BEST ANSWER

You can override templates with z3c.jbot https://pypi.org/project/z3c.jbot/