Hello!
I’m working on project where I need to bind a class property to a page attachment. For this I’m using the attachmentSelector
macro inside the custom displayer of a text property of that class.
Which made me think: why wouldn’t we directly have an “attachment” property type in the product? We already have other text-similar properties like “email” or “date”, which are basically text with custom display / validation. Handling attachments directly as a property type seems quite useful to me too, and would simplify development for future projects needing that feature, and also improve usability for advanced users.
This “attachment” type would use the attachmentSelector
macro behind the scenes, binding for us the className
/property
/object
attributes to the corresponding property. It could have a few customization options, in order to control some other useful properties of the attachmentSelector
macro, like buttonText
, filter
, or width
/ height
.
Wdyt?
Clément