-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add "create new item" option to the content item picker to allow the user to select a new content #11648
Comments
Main concern is a link would lose the current state of the form, or it should open a modal (problematic in some clients). Another solution could be to store the current state of the form in local storage, navigate to the new page, and restore the state when the page is closed (could be recursive). |
We could go to the creation page of the content item, then a return URL should come back to the original page |
yes you can do that. But if you are in the middle of filling info about a content item, you'll lose what you already filled out. It's best to use modal/popup window to create the new item. This should be easy to achieve |
The idea is to return back the created content item id, this way it will be selected automatically once the redirection happens. The modal window is another approach that achieves the goal but you need to show the content type fields (think if it contains a lot) and all the logic will be on the same controller I never mind which approach we should use, rather than add this feature |
But what if you are in the middle of creating a content item, and then you also needed to create an item for the picker, the redirection will cause you to lose your form data. The new controller should be simple as it'll return json with HTML and script just like we do for widgets |
I see what you mean, ya the redirection will lose the data unless we save it in local storage. Anyhow as I said before we need to implement such a feature because it's handy in many scenarios |
Is your feature request related to a problem? Please describe.
In many cases I find myself needing to select a content item that does not yet exists using a content-field-picker. So in that case, I have to navigate to a different screen, add the content that I need to use before I can add the content and select it.
Describe the solution you'd like
I think adding a button next to the context picker that gives the user "+ Add" option would be a huge help. Showing the add button should be part of the configuration so if one does not want that feature it won't be there. I addition to the configuration, this options would only be available if the the user has
EditContent
on the content type being selected.This options would come in very handy when the user want to add a basic content type like "Customer", "Business", etc.
Use case imagine I am trying to add a new content type called "Opportunity". The Opportunity content type has a
RequiredCustomerPart
that providers a customer's picker field (i.e.,ContentPickerField
). The opportunity belongs to a customer that does not exists. Now I'll have to first go to a different view to add the customer then come back and add the opportunity.This can be achieved by rendering the new "Customer" view in a (modal)[https://getbootstrap.com/docs/4.6/components/modal/] and when the record is added, we'll automatically select the new record in the content field.
Bonus
Another thing would be nice from the user experience (previously overlooked in #10942) is to also add a check mark on the right side of the selected items on the menu itself. This would tell the user if an option is already selected when the menu is open. Like if the user want to select 5 options, then close the menu and open it again, it's nice to indicate which 5 he/she already selected.
Also, when the menu does not allow multiple selections, instead of disabling the "Type to search" a better options may be
The text was updated successfully, but these errors were encountered: