ExpressionEngine

2.5.1 User Guide

Relationships

Introduction

ExpressionEngine allows you to create relationships between entries.

Imagine that you run a nightclub where a different performer plays each night. Every day you submit a new entry to your “Events” Channel that tells your customers which performer is playing that evening, along with information (biographies, etc) about the performer. Since many of the performers appear regularly at your club, over time you end up with a lot of duplicated information in those entries. And if any information about a performer changes you have to update it in every entry that mentions them. Before long you realize that this is not very efficient.

If only you could maintain a second Channel in which you store only information about each performer, and then connect it to the main “Events” Channel so that you would never have to duplicate information. Guess what? You can, with relationships.

The following graphic illustrates the concept. The “Events” Channel on the left is showing information from the “Performers” Channel on the right. Only a relationship exists between the entries. The data itself is never duplicated.

image0

Creating a Relationship

Add a field of the “Relationship” type to the desired Channel Field Group at Admin ‣ Channel Administration ‣ Channel Fields.

On the field’s settings page, choose the Channel to relate to. Once the field is added, if you visit the Publish page for the Channel you just added the Relationship field to, you’ll see a new drop-down menu showing the titles of all Entries in the related Channel.

User Contributed Notes

You must have an ExpressionEngine license and have attained a forum rank of "Lab Assistant" (100 posts) to contribute notes to the User Guide