O'Reilly logo

Drupal 8 Module Development by Daniel Sipos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Content entity bundles

We have written a neat little piece of functionality. There are still improvements that we can, and will make but those are for later chapters when we cover other topics that we will need to learn about. Now, however, let's take a step back to our content entity type and extend our products a bit by enabling bundles. We want to have more than one type of product that can be imported, bundled, which will be an option to choose when creating an Importer configuration. However, first, let's make the Product entity type "bundlelable".

We start by adjusting our Product entity plugin annotation:

/** * Defines the Product entity. * * @ContentEntityType( *   ... *   label = @Translation("Product"), * bundle_label = @Translation("Product ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required