Back to all Blog

Referencing Multiple Content Types

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: