Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By bvandenbroeck on
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
Use taxonomy/select drop down/checkbox feature
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
usefull, but not sufficient as proposed solution
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 ;-)
Webforms
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
~
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