Drupal custom content type establishing a parent and child

2.3k Views Asked by At

I am currently building a site on Drupal and I am struggling to work out how to have some parent content (that is created through a custom content type) and some child content that is created through a different custom content type, is this even possibe?

The outcome would be to have some output that would look like this?

  • Service Number 1
    • Product Number 1
    • Product Number 2
    • Product Number 3
  • Service Number 2
    • Product Number 4
    • Product Number 5
  • Service Number 3
  • Service Number 4
  • Service Number 5
    • Product Number 6
    • Product Number 7

From the list example above you can see that I am wanting to create a nested list that will form some navigation. I have a content type called "Services" set up and a content type called "poducts" also created, but I see no way of linking products to services.

Should I even be using custom content types for this? Or would better way to do be go down the route of using taxonomies? If that were the case how can I make a taxonomy link to a product or service page, and not it's own taxonomy page?

I feel like I talk complete nonsense, essestially I cannot work out an uncomplicated way to create a nested navigation in Drupal.

2

There are 2 best solutions below

0
On

We get requests for sites structured like this all the time. A combination of these modules always does the trick for me:

0
On

You can use Entity Reference module for this.

Create the two content types: 'Services' and 'Products' and in Products (child) content type, add a mandatory "Entity Reference" field that references to a Services' node (parent).