4

I have a specific use case that does not seem to be covered by existing Drupal 7 modules. I need to be able to create a "content type" that is created by choosing from a list of existing content.

Use Case:
A company that trains new pilots needs two content types:
Type 1: Schedule a training flight.
Type 2: Post training flight details.

Type 1 has the following fields:
(flight_id,trainer_name, plane_name, new_pilot_name, date, airport, flight_status)

IMPORTANT:
Type 2 is created when an admin clicks on the flight_id from a list of scheduled flights.

Type 2 is required to contain the following data/fields:
(content from type 1, trainer_notes, new_pilot_grade)

  • I'm not sure I get you: "I need to be able to create a "content type" that is created by choosing from a list of existing content" ? Or do you need to create a content instance? If the latter then I don't see why Entity Reference cannot do the job for you. And do you want to edit the fields from content type 1 in content type 2? – J. Reynolds Jun 30 '16 at 12:35
  • If this is for drupal 7 please add the tag. My answer is only for drupal 7 – Adrian Cid Almaguer Jun 30 '16 at 14:03
  • Which Drupal version are you using 7 or 8? – No Sssweat Jul 4 '16 at 22:11
  • Do you found a solution? – Adrian Cid Almaguer Jul 14 '16 at 13:58
  • @AdrianCidAlmaguer Yes. I use entity reference and choose from a specific content type. The user then has to select from a dropdown list. It is not a two step solution, but it is useful enough to meet use case requirements. Your answer was helpful. – Mike Stratton Jul 14 '16 at 14:25
5

You can use Entity reference:

Provides a field type that can reference arbitrary entities:

  • A generic entity reference field
  • Four widgets:
    • Two implemented on top of the Options module (Select and Radios/Checkboxes),
    • Two autocomplete widgets (one with one text field per entry, one tag-style with comma-separated entries in the same text field)

And the Inline Entity Form module:

Provides a widget for inline management (creation, modification, removal) of referenced entities. The primary use case is the parent -> children one (product display -> products, order -> line items, etc.), where the child entities are never managed outside the parent form. Existing entities can also be referenced.

Others similar modules to Inline Entity Form:

Entityreference Autocreate

A deliberately simple way to invent nodes on the fly in order to refer to them via entityreference.

References dialog (beta2 release only)

This module extends reference fields like the user and node reference fields by adding links to add, edit and search for references through a dialog.

Autocreate Node Reference

Autocreate Node Reference adds a node reference field and automatically creates the referred node by cloning a template node.

Node Reference Create

Node Reference Create is an enhancement to the nodereference autocomplete widget that allows users to reference non-existent nodes.

Entity connect (rc5 release only)

It will help you to improve the User Experience for creation of new entities or edition of linked entities on your entity reference fields.

The "add a new" button will enable you to add / create a new entity. The first form will be cached then the new form will be generated. Once the new form is completed and saved the user will return to the original form.

EDIT: The module most used is Inline Entity Form, but it doesn't works with the Automatic Nodetitles module, but I know that Entity connect works fine with it. In addition with Entity connect you can edit existing entities. In my case I prefer Entity connect.

| improve this answer | |
  • 1
    Wow, interesting "list"! Maybe you should add some guidances in your answer to help decide which one to go for in which situations (and also indicate modules that do not have an official D7 release yet, which I often use as a criterium to reduce such list). – Pierre.Vriens Jul 16 '16 at 8:29
  • @Pierre.Vriens I've added additional information. But feel free to edit the answer. – Adrian Cid Almaguer Jul 18 '16 at 13:05
2

You can use the field node References module

With it you can add the content types you want as fields in your new content type and then use views to display it.

| improve this answer | |

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.