Closed thet closed 1 year ago
@gforcada something like this? https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
But I would not include any attribute validation. It's up to the developer to add correct attributes. That allows also for any data-*
attributes or special non-standard JS frontend framework attributes.
@icemac tnx for the review! I implemented your suggestions.
Came out of necessity and the discussion at: https://github.com/plone/plone.app.z3cform/pull/176
See the z3c.form.browser.widgets.rst doctest on how to use it. Basically it allows for attribute expansion in Chameleon templates like:
You can just set individual attributes like so:
There is no need to include the outdated and incomplete list of HTML attributes in the templates anymore. You can just set them via Python.
Note: This attribute expansion does only work that way in Chameleon. Therefore we cannot change any of the templates in z3c.form because - I think - it needs to stay compatible with the Zope PageTemplates reference implementation.