-1

I'm creating a paragraph type that represents a Slider. It has a couple of simple fields like "title" and "subtitle". It also has a variable number of tabs. The tabs are where the real content is.

Tabs have a title, and a variable number of entity references (to Movies, Characters, etc.). The entities all have an image and link associated with them so a user can click through to the entity's page. I created a taxonomy for Tabs and it has a two fields: the title and a list of Entity references.

Essentially there is a hierarchy: Slider contains tabs, tabs contain entities like Movies.

So in the end, the Slider paragraph type has a list of taxonomy tabs. The problem I have now is that the UI for adding a Slider to a page shows only the Slider's title fields and a list for the tabs as references to existing instances of a tab.

That is, a tab needs to be created beforehand in a separate tab taxonomy UI before it can be referenced in the Slider's properties.

My question is: Is there a way to change the form UI to create instances of a Tab taxonomy on the fly, while I am creating an instance of the Slider Paragraph type. I would like to create a complete slider on one form without having to jump back and forth to another page to modify the tabs of the slider.

For clarification, here's a rough mock up of how the tabs are organized in a slider.

enter image description here

  • I think this will probably get closed as recommending a module/opinionated. I think what you are asking is whether or not there exists functionality to let users create entities while creating a different entity. There is inline_entity_form that would probably allow tat. – mradcliffe Oct 19 '17 at 18:24
  • Sounds like this could be done with inline entity form and hook_entity_create() to create tab taxonomy terms. – Felix Eve Oct 19 '17 at 23:47
1

The solution I found was to make the Tabs into a paragraph type as well, instead of taxonomy. This way the Slider paragraph type would have a reference to a Tab (or group of tabs) and within the UI form for inserting a Slider, it shows the tabs that make up the Slider, along with a form to populate each tab's data points and references in line. This was what I was looking for. A user now does not need to go to a separate screen to create a tab first, then attach it to a Slider object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.