Back to blog

Referencing Multiple Content Types

Menza MathewJul 30, 2019
referencing-multiple-entries.png
Talk to an expert about something you read on this page

With our latest release, we have upgraded our existing Reference field to make it more flexible than before. The new Reference field now allows a content manager to add references to entries of more than one content type.

What’s New with the Reference Field

The Reference field helps you add references to the entries of another content type. For example, the “Author” Reference field in your “Blog” content type refers to the “Blog Writers” content type. So, while creating an entry, instead of adding the author details manually in the “Author” field, the content manager can add a relevant entry of the “Blog Writers” content type. This is how the Reference field worked until now.

So, what’s new?

While creating a content type, you can now link more than one content type to a Reference field. So, instead of just linking “Blog Writers,” you can also link “Marketing Writers,” “Technical Writers,” and “Legal Writers” to the “Author” Reference field.

Subsequently, while creating an entry for the “Blog” content type, the content manager can add any entry from the above mentioned content types as a reference to the “Author” field.

Note: Stacks created after this release will get the new Reference field by default. To use the feature in existing or older stacks, you need to upgrade the Reference field within the content type.

How to Upgrade a Reference Field

To start using the new Reference field, perform the following steps:

  1. Edit the Properties of the existing Reference field within the content type.
  2. Click on Upgrade.
  3. Save the entry.

This allows your Reference field to include multiple reference content types (max 10 content types) in a single instance.

Likewise, you can revert your upgrade by clicking on the Revert button provided in the properties section. This will downgrade your Reference field back to the older version.

Refer to our documentation to learn more about adding multiple content types to a Reference field and adding entries of referred content types.

How Multiple Content-Type Referencing Affects Functionality

Upgrading your existing Reference fields results in API changes. The primary change is that the input format of your Reference field changes from an array of strings to an array of objects. The change in the Reference field format is as follows:

OLDNEW

{

  ...

"ref_field": ["entry_UID1", entry_UID2,...]

  ...

}

{

  ...

"ref_field": [{

  "uid": "blt1111fe11e111111f",

  "_content_type_uid": "footer"

},{ }, ...

  ...

}

You can refer to the API Changelog document for more details.

SDK Users

If you have used an SDK for developing your digital property, you will need to update the SDK to the latest version to start using the upgraded Reference field.

Refer to our SDK documentation for more details.

DataSync Users

We have updated DataSync and added support for the new Reference field. DataSync users can refer to the DataSync documentation to learn how they can start using the new Reference field.

Helpful Resources

If you haven’t tried it yet, log in to your Contentstack account and check out the new Reference field. For more details, refer to the links below:

Share on:

About Contentstack

The Contentstack team comprises highly skilled professionals specializing in product marketing, customer acquisition and retention, and digital marketing strategy. With extensive experience holding senior positions in notable technology companies across various sectors, they bring diverse backgrounds and deep industry knowledge to deliver impactful solutions.  

Contentstack stands out in the composable DXP and Headless CMS markets with an impressive track record of 87 G2 user awards, 6 analyst recognitions, and 3 industry accolades, showcasing its robust market presence and user satisfaction.

Check out our case studies to see why industry-leading companies trust Contentstack.

Experience the power of Contentstack's award-winning platform by scheduling a demo, starting a free trial, or joining a small group demo today.

Follow Contentstack on Linkedin

Background.png