Override widget templates

Can widget Templates (Template.pt) be overridden with jbot, for example from a theme?

Should be possible. If you ask: is there an issue?

I did a quick test (before I left work for the day). It did not work, but maybe did something wrong.

I did a (quick) read of the description and it said:

Any template that is defined as a class-attribute can be 
overriden using jbot, e.g. those used in 
views, viewlets and portlets.

So it did not mention widgets, but maybe it is (still) possible

@espenmn Can you show what you've tested and which template you want to override doesn't work? It's a bit vague now for others to respond in detail.

I added

Products.CMFPlone.browser.templates.title.pt

To my theme/template-overrides folder and the changes appeared on my site

Then I added the same file to browser/overrides (and changed it a little) and it also worked.

Then I did the same thing (added to the folders)

 collective.z3cform.datagridfield.datagridfield_display.pt

Trying to override: https://github.com/collective/collective.z3cform.datagridfield/blob/master/src/collective/z3cform/datagridfield/datagridfield_display.pt

But the changes were not 'happening'.

You're going to have to do some deep reading, modifying forms is an interesting and challenging task :wink:

Start here, don't skip anything...

https://docs.plone.org/develop/plone/forms/z3c.form.html
https://z3cform.readthedocs.io/en/latest/

1 Like