- Issue created by @devanbicher
- 🇺🇸United States jrockowitz Brooklyn, NY
I think we need to create a MercuryEditorTasksInlineEntityForm service for just the preprocess hook.
- First commit to issue fork.
- @immaculatexavier opened merge request.
- 🇺🇸United States devanbicher
Here are the steps to setup a site to expose this functionality
- Enable mercury editor and inline entity form
- Add a new content type
- Add a layout paragraphs field
- Enable that content type with mercury editor
- Create a paragraph
- In that paragraph, add a content reference field that references nodes
- Have its reference use the content type you created above, save
- Edit the new paragraphs' form mode
- For the content reference field in this paragraph change the form mode to 'Inline entity form - complex'
- Go back to your content type and add this paragraph to the layout paragraphs field
- Create a new piece of content (of the type you created in step 3)
- You just need to title it, you don't need to add any other content, save
- Create another piece of content of the same type
- Edit the layout of that new piece of content
- Add a paragraph of the type you created in step 6
- In the content reference field of this paragraph, select 'add an existing node'
- Search for the piece of content you created in step 12 (it should probably be the only one in the list) and select it
- After the entity select modal goes away there should now be another button after 'edit' that says 'Layout'
- That 'layout' button in the inline entity form is what this patch adds.
- First commit to issue fork.
- 🇺🇸United States joelsteidl
@devanbicher thanks for the detailed setup tasks. That was super helpful for writing a test.
@immaculatexavier thanks for getting the service started. I made an interface and broke up the main function into some additional methods to keep things a bit simpler.
Thoughts/Questions
- The UI for the "Layout" button is slightly off at least in Claro. The other buttons are actual button elements vs the href we are adding. Not sure it is worth addressing, but open to thoughts.
- There is currently no config for this. If you have IEF enabled under the right circumstances, it happens. Are we good with that?
- Similar question...it used the Local Task name for the IEF button. Any reason to make that different?
- 🇺🇸United States devanbicher
@joelsteidl
- The element being a link instead of a button was a mistake that I never went back and fix. If this is getting merged, it should get changed to a button element. Thank you for catching that.
- I am okay with that. But that is the intended use case for us. I guess it would probably be best practice to put a configuration option in the same space where you set the 'Layout' label that allows someone to turn on or off this functionality.
- I think using the same label is fine, but if you are adding a configuration option in number 2, you could add another label field for this button.
- 🇺🇸United States jrockowitz Brooklyn, NY
I think using the same label is fine, but if you are adding a configuration option in number 2, you could add another label field for this button.
The label should be the same across all implementations. I don't think it needs to be configurable for IEF
- 🇺🇸United States joelsteidl
@jrockowitz - I appreciate all the feedback.
I think everything is addressed in Gitlab. Let me know if you see any other issues.