-
-
Notifications
You must be signed in to change notification settings - Fork 612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RelationList Widget #3355
Comments
There is some work done by @nileshgulia1 in this source tree https://github.com/plone/volto/tree/relations-volto Some work needs to be done based on new plone.restapi endpoint @relations https://github.com/plone/plone.restapi/tree/relations-documentation-etc |
@ksuess @nileshgulia1 This bug is quite critical to enable users to select and add relations in Volto. It is my understanding that the blocker in plone.restapi has now been resolved by new proposal by @pbauer https://github.com/plone/plone.restapi/tree/relations-documentation-etc Really appreciate your continue support and contributions in making relations work out of box in Volto! Thank you. |
Katja drafted a PR for relations controlpanel: #3382 |
A bug fix is needed to feed the ObjectBrowserWidget with the vocabulary of the field. |
So, it seems there is a simple way to make this work as expected. Passing Take a look at the implementation bellow from plone.autoform import directives
from z3c.relationfield.schema import RelationChoice
from z3c.relationfield.schema import RelationList
from plone.app.z3cform.widget import RelatedItemsFieldWidget
...
campus2 = RelationList(
title=_("person_campus", default="Campus"),
required=False,
default=list(),
value_type=RelationChoice(
title=_("person_campus", default="Campus"),
vocabulary="plone.app.vocabularies.Catalog",
),
)
directives.widget(
"campus",
RelatedItemsFieldWidget,
pattern_options={
"selectableTypes": ['campus']
},
frontendOptions={
"widget": "object_browser",
"widgetProps": {"mode": "multiple", "return": "multiple"},
},
) To be honest, the only thing I would like to have more was a way to pass a start point for the ObjectBrowserWidget start the search tree. @arky, @ksuess, @nileshgulia1, what do you think? |
Unfortunatly this does not work for me:
I think ObjectBrowserWidget needs some attention.
BTW your frontendOptions is the default for factory |
Also still open:
|
@arky added to the 16 Milestone. |
Thank you @sneridagh for including this in the release milestone.The ability to add multiple relationships in Volto would make relations first class citizen in Plone 6. |
Thank you! \o/ |
See documentation: https://docs.plone.org/volto/recipes/widget.html#relation-fields |
If your content type uses 'Relation List' then there a not usable since there is dedicated widget to handle this type. I think current placeholder refers to Object Browser Widget. I think Relation Choice might also suffer from limited functionality.
Is your feature request related to a problem? Please describe.
This lack of widget makes selection and adding of relations in Volto impossible.
Describe the solution you'd like
Add a new widget based on existing volto list widgets.
volto/src/config/Widgets.jsx
Lines 76 to 79 in d1ebf8c
The text was updated successfully, but these errors were encountered: