Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Alternate resources: 

Make your Entity Fieldable with Bundles

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:05
    [Blake Hall] In order to take advantage of the fields provided by Drupal, we'll need to make our entity fieldable.
  • 0:10
    In order to do that we'll need to create a custom bundle.
  • 0:14
    A bundle is basically just a collection of fields that you can put on your custom entity.
  • 0:18
    We'll dig through some code that makes this possible and allows us to leverage the fields provided by Drupal
  • 0:23
    and add them to our custom entity.
  • 0:26
    Now that we have our custom video entity rendering and the admin form taken care of,
  • 0:32
    let's take a look at how to make our entity fieldable.
  • 0:35
    Making our entity fieldable will expose it to field API, so that other fields can be attached to our entity,
  • 0:41
    And then later made use of in Views.
  • 0:44
    Right now if we visit our admin interface, the only operations we have available are to edit or delete our entity.

Make Your Entity Fieldable with Bundles


Bundles are an implementation of an entity type to which fields can be attached. In this lesson we’ll take a look at configuring a single bundle type for our entities in order to allow us to make them fieldable by hardcoding the bundle information into hook_entity_info(). This is the most basic implementation of bundles. Then we’ll look at adding the ability to attach fields to our newly created bundle.

Log in or sign up to download companion files.

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.