Back to All Videos

Intro to the Link Field

4m 38s

Link fields are another nifty solution to show that different content types have a relation to one another, without needing to create duplicate fields to repeat content over and over again.

In the video, we take on the example of how blog posts are related to authors writing the blog posts, each being their own individual model. But why take this approach? Blog posts have authors, so technically, you could always extend the blog post model to have an author name, author avatar, and author bio. That would work.

But then the same author's written multiple posts. Why fill out repetitive information over and over again? This is where links come in!

We simply need a single author, let's call them Veel. Veel's written multiple blog posts, so she can be linked to them every time a new post is created, no repeating content every time!

The link field also comes in two flavors:

Single Link: The ability to link to just one other model, i.e, a blog post to an author, or

Multiple Links: The ability to link to a collection of eternal records, i.e., a blog post to a group of authors.

On the Validations side, there isn't much new here, save for the inclusion of you having to select which model(s) can be linked to via the model you're creating.

On the presentation side, however, you can select whether editors see a compact view (i.e. pills with the title of the field related), or an expanded view (tabs with a little more information.)