Hi,
I am using drupal 8, clean (default) installation.
What I want is fairly simple:
I created two content types: "Course" and "Specialization", each with some specific fields.
I added "Specialization" is an entity-reference in content type "Course".

When I create content "Course", I would like to display the content-type "Specialization" as a sub-form within the main-form of content-type "Course".
Instead of showing the default select/search field.

Can you guide me how to do that?

Many thanks in advance!

Comments

sachinsuryavanshi’s picture

Create 'Course' content type from Content structure but don't create content type for 'Specialization'.(use Taxonomy feature instead)

Taxonomy is best for categories your content ->@ http://valuebound.com/resources/blog/manage-your-article-using-taxonomy-in-drupal-8

You can also use select box for selecting specialization or Checkbox for Specialization

Let me know if you have any doubt over this.

Thanks,
Sachin

bvandenbroeck’s picture

Hi,
The thing is, that in "Specialization" I have specific other fields (like other reference-fields, list-field,...) that are not available in a taxonomy-term.
I understand your solution, but since I have these other specific fields, this doesn't help me.

The main goal I try to achieve is to have "one form", in which I can create the two-content-types, where one sub-content-type (Specialization) is an entity-reference of the main-content-type ("Course").

Hope I make myself clear here ;-)

sachinsuryavanshi’s picture

Why don't you use webforms module for this?

You can add various fields based on your requirement- check below URL
@https://www.drupal.org/project/webform

I will find more solution, stay tuned

pixelsweatshop’s picture

I would like to display the content-type "Specialization" as a sub-form within the main-form of content-type "Course".

Can you explain this further? If you mean you want the ability to create new "specializations" from within the "Course" creation, then you are going to need https://www.drupal.org/project/inline_entity_form