- Issue created by @a.dmitriiev
- 🇩🇪Germany a.dmitriiev
I found these modules https://www.drupal.org/project/extra_field → and https://www.drupal.org/project/extra_field_plus → that can be used to add frontend editing element to view display and also have configuration for it.
-
a.dmitriiev →
committed 5f0880ad on feature/3436684-proof-of-concept
Issue #3436684: [Meta] Plans for 2.x
-
a.dmitriiev →
committed 5f0880ad on feature/3436684-proof-of-concept
- 🇩🇪Germany a.dmitriiev
I have created branch 2.x from current state of 1.x and create proof of concept in MR https://git.drupalcode.org/project/frontend_editing/-/merge_requests/54 . This concept is based on the modules https://www.drupal.org/project/extra_field → and https://www.drupal.org/project/extra_field_plus → to have frontend editing action links be placed by users to view modes where they need it. It is also possible to select the form mode that will be used for the form that is opened in the sidebar. This can also be a good start for this issue https://www.drupal.org/project/frontend_editing/issues/3421150 ✨ Allow editing arbitrary fields in the frontend Active .
I tried to cover all the ideas that were in issue description. In addition that now user can define for what view displays the frontend editing action links are displayed, it is still possible to define whether they are needed at all for a bundle of content entity type. Every bundle edit form now has "Frontend editing" tab, like for example "Simple sitemap" or "Publishing options" (for nodes). If frontend editing is not enabled for given bundle, "Frontend Editing: Actions" element will not be available in "Manage display".
Also now changing the order of entity reference field items is not only for paragraphs, any entity reference is allowed, you can change the order of the field that references nodes, media, custom entity type (content entity type), etc. The add buttons are also now for all entity types (content entity types). Move up/down arrows and plus buttons are controlled with field formatter settings, so now it is crystal clear how to make the extra actions appear/disappear.
I also tried to create update hooks to "migrate" old configuration settings to new format.
Anyway this needs very thorough testing. When there is some feedback, it will be decided whether proof of concept worth it to be merged to 2.x branch and then the bugs fixing phase will start.
-
a.dmitriiev →
committed ea55bb11 on feature/3436684-proof-of-concept
Issue #3436684: Allow editing field reference formatter only when...
-
a.dmitriiev →
committed ea55bb11 on feature/3436684-proof-of-concept
- 🇩🇪Germany a.dmitriiev
I forgot to mention how to test.
If you are testing on existing installation where frontend_editing of version 1.6.x is installed:
1. Pull new dependencies with
composer require drupal/extra_field_plus:^3.0 drupal/extra_field:^2.0
2. Delete folder web or docroot/modules/contrib/frontend_editing
3. Navigate to web or docroot/modules/contrib folder
4. Clone the repository `git@git.drupal.org:project/frontend_editing.git` and then checkout this branch feature/3436684-proof-of-concept
5. Run drupal updates
6. Check that your previous settings from frontend editing are still working, but in bundle edit form, manage display has "Frontend editing: actions" extra field, ...If you install frontend_editing for the first time in the project:
1. Pull new dependencies with
composer require drupal/extra_field_plus:^3.0 drupal/extra_field:^2.0 drupal/paragraphs_edit:^3.0
2. Navigate to web or docroot/modules/contrib folder
3. Clone the repository `git@git.drupal.org:project/frontend_editing.git` and then checkout this branch feature/3436684-proof-of-concept
4. Install the module - 🇩🇪Germany breidert
When testing the feature branch on an existing installation you also need to enable the new modules.
After replacing the code with the code from the feature branch I had to execute the following commands:
composer require drupal/extra_field_plus:^3.0 drupal/extra_field:^2.0 drush en extra_field_plus drush updb
After this the update runs without error and the new functionality shows correctly.
- 🇩🇪Germany breidert
Here are screenshots of the configuration I have.
For an existing paragraph with three fields I added a new form mode called
frontend_editing
that only contains one of the fields. After selecting this form mode in the display, I correctly can only edit the configured field. - 🇩🇪Germany breidert
Configuring reference fields also works.
Paragraph reference:
Media reference:
Make sure the entity types and bundles you are configuring are enabled.
-
a.dmitriiev →
committed aebf03a3 on feature/3436684-proof-of-concept
Issue #3436684: Allow editing field reference formatter only when...
-
a.dmitriiev →
committed aebf03a3 on feature/3436684-proof-of-concept
-
a.dmitriiev →
committed 11371f15 on feature/3436684-proof-of-concept
Issue #3436684: [Meta] Plans for 2.x
-
a.dmitriiev →
committed 11371f15 on feature/3436684-proof-of-concept
-
a.dmitriiev →
committed 060c463b on 2.x
Issue #3436684: proof of concept
-
a.dmitriiev →
committed 060c463b on 2.x
- Status changed to Needs review
8 months ago 11:31am 19 April 2024 - 🇩🇪Germany a.dmitriiev
I merged all changes from 1.x branch to 2.x. Brief check was ok, but it might be some more regressions.
- Status changed to Fixed
8 months ago 6:48am 1 May 2024 - 🇩🇪Germany a.dmitriiev
It was decided not to use bundle form for controlling frontend editing status, as not all content entities have bundles. So the setting is still in frontend editing settings in admin UI on a separate page. This allows to use frontend editing on non-bundle entities.
The changes were merged to 2.x and 2.x-dev release was created.
Automatically closed - issue fixed for 2 weeks with no activity.
- 🇩🇪Germany a.dmitriiev
@ugintl please specify what exactly you would like to do with frontend editing while using layout builder? At the moment, if you use in layout builder the field that references other entity - you can edit that referenced entity, including custom blocks.
I would like to add the support of layout builder, but it would be nice to know what are the needs of users, what are the requirements. Several questions were asked about this, but till now I have no clear picture what exactly is needed.
If you are interested, please create a new feature request and described what would you like to have? That would help a lot.