concrete5/concrete5 — Issue #373: What are the plans for attributes
Author: Willemh
Created: 2011-12-17 15:16:50+00:00
State: open

While i am building a package with support for attribute categories and new attributes i am realizing there is quite some work on the attributes when it comes to displaying, rendering input forms and validation.

i have been investigating client side validation, server side validation, attribute sets and the ability to overload attributes in packages. i feel that there is a lot of work to be done here, to make this all play nicely together. But before i start diving into this, are there any plans to make improvements here?

I am thinking of the following:
1. Include validation rules into the attributes
2. Create a validation rule UI component for attributes in the dashboard. This would need to provide something like this:
a. add rule: ('required', 'message')
b. add rule: ("min", "value", "message")
c. add rule: ("remote", "callback", "message") (for checking on unique values etc)

3. With these rules in place in the attributes themselves, you can render input fields where client side validation is handled by the user agent (HTML5) or jquery (jQuery.html5form). This should play nicely with the twitter.bootstrap form elements.
4. User the same rules for server side validation.
5. make a better separation between the attributes and the render function. It should be easier to create custom render functions in packages. If you look at the way address is implemented today, this is pretty hard.
6. How to work with attribute sets? I think it is great that there is a way to bundle different fields in sets, but this requires rewrites on a of pages (registration, profile edit etc)
7. Is the address attribute still viable now that sets are introduced? Would it not be easier to create an address set, with the required fields?
8. It is not possible to overload an attribute form in a package.

Before i start doing the work here i need for my own implementation, i would like to understand what the plans are. Is this something that will be addressed in the near future?

Let me know your thoughts