Is there a way to switch back to RelatedItemsFieldWidget as default widget in Plone 6.1 Classic? I could not find some documentation about that.
You must modify the package plone.app.relationfield/plone/app/relationfield/behavior.py at 981f5bb7b529e1cf8ffafd6001d81f17edaaa67f · plone/plone.app.relationfield · GitHub
Can i ask you: Why? In my opinion the Contentbrowser ist the better UI. I would be interested in your opinion or your problems with the new UI.
Thank you. This works for "Related Items" but if a want to add a link in TinyMCE there is still the Contentbrowser. Do you know where to change this too?
Can i ask you: Why? In my opinion the Contentbrowser ist the better UI. I would be interested in your opinion or your problems with the new UI.
Sure. I like the new Contentbrowser. But there is some concern in our team, that our users can not handle it. We have very deep folder structures and it is not so easy to go back to a higher level if you have selected a deep level because the higher level moved out of view.
At the screenshot I have to select folder "three" to see folder "one" and "two" again. Here a horizontal scrollbar could be helpful or something like a close button to close a level and move view back to higher level, e.g. close folder "seven" than "one" and "two" were visible again.
So we want to investigate if there is a way to switch back to RelatedItemsWidget, just in case we need it.
By the way: Are there any options to customize Contentbrowser?
The changes are introduced here: `pat-contentbrowser` implementation by petschki · Pull Request #1377 · plone/mockup · GitHub but @petschki know more.
the config for contentbrowser widget is the same like for relateditem widget.
Please open an issue for the problem of deeply nested structure.
I have created:
@petschiki: If you have some information how to to use RelatedItemsWidget in TinyMCE again, this would be great.
Hm. The tinymce integration is quite hard wired in pat-tinymce
but it may be not that hard to add an option to get pat-relateditems
back again. By now the only option is to stay on plone.staticresources<2.2
.
At least the column issue is fixed here `pat-contentbrowser` improvements by petschki · Pull Request #1420 · plone/mockup · GitHub ... I took a quick look how to get pat-relateditems
back into tinymce but that needs to be discussed with more people (since we want to get rid of it completely because of the old and custom patched select2
implementation)
@KrissiK I had a similar issue. I updated an old widget I helped build years and years ago with a new vuejs based widget and the plone restapi. It does work pretty well and is battle tested. The code itself is probably not super beautiful, it got a bit butchered over the years.
See ftw.referencewidget · PyPI
Main feautures:
- Search and traverse large structures.
- fine tune what content types are traversable
- fine tune what content is selectable
- start path, custom filters, etc.
-
The widget only shows a button in edit mode.
-
Opens an area (not an overlay), which shows either radio buttons, or checkboxes depending on single or multi value field. Search and sort options, Items in current context, breadcrumbs, review state, portal type, batching if necessary.
-
Selected items can be reordered via drag and drop
More:
- based on bootstrap from the classic ui
- registered as a pattern for patternslib.
Give it a shot, i might help in your case.
@maethu nice implementation. But @KrissiK needs this for Tinymce Image/Link integration. Does this patterns support this too?
ohh sorry did not read properly.... Nope, not anymore.
If there is any interest, I can try to bring that feature back.
@maethu: I wish I had known ftw.referencewidget earlier, that looks great. At the moment we want one kind of select widget to not confuse our users.
@petschki: The fix for the column issue is very helpful - thx. Maybe we can stay with Contentbrowser.
So the column issue got fixed here https://pypi.org/project/plone.staticresources/2.2.0b4/ ... we're putting efforts in this pattern because we want to get rid of some very old libraries in the mockup stack (as I said above). Feel free to open issues in the mockup repository.
There is also an open issue with some improvement suggestions to the search (global vs. current level only): allow global search in pat-contentbrowser per default · Issue #1403 · plone/mockup · GitHub
And I recently started to implement component customization with the options provided (See `pat-contentbrowser` component registry by petschki · Pull Request #1396 · plone/mockup · GitHub) ... currently the SelectedItem
component can be customized with your individual Svelte component. (I've implemented this in an addon of us as a POC here: Contentbrowser upgrade with customized `SelectedItem` svelte component by petschki · Pull Request #18 · collective/collective.behavior.relatedmedia · GitHub ... Since this is used in prodution for a customer project here, we'll finish and release this soon.)
More components to come ...
@MrTango and I were also talking about making it possible to create subfolders from within the contentbrowser so you could expand your site structure while uploading Files/Images without leaving the current add/edit form ... as usual this should only be possible for specific permitted roles ...
The relative merits depend on how one is using RelatedItemsWidget, to some degree: if you have stripped down RelatedItemsWidget to just focus on search, and hide all browse control with config and CSS — you will likely find pat-contentbrowser too "big" for the task (both literally and figuratively).
You could say: "well, just use Select2" which makes sense, but pat-contentbrowser is hardcoded now in TinyMCE in released mockup, with no configuration options to fall back.
In all fairness, I have not yet tried any single-column search mode in pat-contentbrowser. For now keep a site I was upgrading meeting its incumbent requirements, I ended up having to pin (for now) older packages (corresponding to last 6.1 alpha):
plone.app.relationfield == 3.0.5
plone.app.z3cform = 4.6.1
plone.staticresources = 2.2.0a10
On a larger site (thousands of items) where "place content is stored" is not the relevant factor (regardless of nesting depth), search-focused discovery makes more sense.
thx for your feedback, this is really valuable.
I'm pretty sure we can improve the Contentbrowser to be useful in more of the above scenarios. The global search feature should help there and we also have plans to simplify the UI for this case.
For simple selections including search, I'm using a RelationChoice with a Select2Widget and a StaticVocabulary.
Please keep reporting your thoughts, so we can make the Contentbrowser a tool everyone wants to use.