Customizing the user profile edit view: adding repeatable fields to member fields and the personal-information view

I'm looking for a way to personalise the member fields in the user profile interface
I want to override the personal-information view to support nested/repeated text values. For example if you wanted someone to show the websites they've built using a "my sites" option.
see the screenshot below:

Here's what I'm seeing:

  1. The personal-information view is dynamic, as new member fields are added, the profile dynamically gets those fields
  2. There is repeatable/clonable field. We are currently constrained to the available field types (text, text-line, url, etc..).

I want the personal-information view to contribute to dynamically work with member fields

It seems that what I need to do is add the ability to

  1. add "repeatable fields" to the member fields
  2. then make personal-information smart enough to use repeatable fields

Rather than a "repeatable/clonable" field, I would think of this as a single field of type List with a value_type of URI or TextLine.

The user schema can be edited via the /member-schema view or userschema.xml in a GenericSetup profile. The code which handles schema updates is in plone.app.users/plone/app/users/browser/schemaeditor.py at master ยท plone/plone.app.users ยท GitHub ... it takes care of updating the member property schema in portal_memberdata (which is where user properties are actually stored) based on the Zope schema.

Currently it looks like it handles Set fields but not List, so it probably needs some additions to handle your use case.

1 Like

:thinking: and would that propagate to Volto's profile view (personalInformation)? I suspect there may be work needed there too.

I don't know how that schema gets published to the User form, but you can set the widget type hints. Forms and widgets โ€“ Frontend โ€“ Development recipes โ€” Plone Documentation v6.0

1 Like