Building views
This documentation needs work. See "Help improve this page" in the sidebar.
Model
When building views, it is important to recognise the RNG entity model. See Data and relationship model for the full outline of the entity model. It is important to understand the model in order to build views.
Event ─► Registration(s) ─► Registrant(s) ─► Person
Event is often Content (From Node module). Person can be any valid person type, but is often a User.
The entity model initially seems complex. But its complexity allows RNG to be very flexible when integrating with the rest of the Drupal ecosystem. It means there is no bias towards certain entity types, including entity types bundles with core, such as Content or User.
Note: Event and Person entity types must implement their own views integration otherwise they will not show in the Views interface. Views integration is a concern of developers. Site builders do not need to concern themselves with this aspect.
Relationships
Building views which includes two or more entity types from the RNG entity model will need to make use of Views relationships.
When creating relationships, you should usually be checking the Require this relationship checkbox.
The following examples show how to create relationships between entity tables. It is not required to create the full relationship chain if you do not need it. For example: you do not need to add a relationship to the 'Person entity type' if you only require event and registration data.
Base entity type: Event
You usually want to build a view with the base entity type the same as your event entity type in order to build views such as:
- A list of registrations for an event.
- A list of people registered for an event.
Entity type | Relationship field name | Relationship field description | Note |
---|---|---|---|
Event entity type | Base table | ||
→ Registration | Reverse reference to Event base field on Registration | Reverse reference from ??? entities referenced by Event base field on Registration entities. | Where ??? is your event type. |
→ Registrant | Automatic relationship | ||
→ Person entity type | Identity to ??? entities | References to ??? entities referenced by Identity base field on Registrant entities. | Where ??? is your person type. |
Base entity type: Registration
You usually want to build a view with the base entity type as Registration in order to build views such as:
- A list of people associated with a registration.
Entity type | Relationship field name | Relationship field description | Note |
---|---|---|---|
Event entity type ← | Event to ??? entities |
References to ??? entities referenced by Event base field on Registration entities.
|
Where ??? is your event type. |
Registration | Base table | ||
→ Registrant | Automatic relationship | ||
→ Person entity type | Identity to ??? entities |
References to ??? entities referenced by Identity base field on Registrant entities.
|
Where ??? is your person type. |
Base entity type: Person
You usually want to build a view with the base entity type the same as your person entity type in order to build views such as:
- A list of registrations for a person.
- A list of events a person is registered.
Entity type | Relationship field name | Relationship field description | Note |
---|---|---|---|
Event entity type ← | Event to ??? entities |
References to ??? entities referenced by Event base field on Registration entities.
|
Where ??? is your event type. |
Registration ← | Registration | The registration associated with this registrant. | |
Registrant ← | Reverse reference to Identity base field on Registrant | Reverse reference from ??? entities referenced by Identity base field on Registrant entities. | Where ??? is your person type. |
Person entity type | Base table |
Contextual Filters
needs work
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion