Blog

Luis Majano

July 10, 2014

Spread the word


Share your thoughts

One of the newest features of ContentBox is the ability to define related content for Entries, Pages, and ContentStore objects. Whether it's simply rendering a list of related content links, or creating complex data relationships for use in custom development, the sky is the limit for how you can use this new feature within your ContentBox apps!

Defining Related Content

Adding related content to your content is simple. While adding or editing your content, simply open the Related Content management panel, click "Add related content" and choose from any of the published Entries, Pages, or ContentStore objects that appear. As you choose related content, the list of available content will automatically filter.

Linked Content

The Linked Content management panel shows you a handy overview of all the places that your current content is being used as related content in other places. For example, let's say you are have a "Services" page that is used as related content on the "About" and "Work" pages. When editing "Services", you'll see that "About" and "Work" show up in the Linked Content panel, indicating that they are using your current content. At any time, you can remove the link, which will remove the related content relationship. So whether you are adding related content to your content item, or wanting to manage how your content item is used as related content elsewhere, you can do it all from one place!

Related Content Widget

Included with support for related content is a new core ContentBox widget called Related Content. You can drop this into your content wherever you like (or use it in a layout) and it will render a list of related content.

NOTE: Only Page and Entry related content links will be rendered by the widget.

Developing with Related Content

For those who do custom development around content within ContentBox, the additions to the model for related content are very straightforward. Two new properties (relatedContent and linkedContent) have been added to the root content model. Once you have an instance of any content object (ContentStore, Entries, or Pages), you can simply use the getters for relatedContent and linkedContent to retrieve all the related and linked content for your instance. Both of these will return an array of content objects that you can interact with just as you would any other content. So whether you're creating your own custom "Related Links" widget, rendering related content alongside your main content, or doing some other awesome thing that we haven't even thought of yet, you have very easy access to interact with related and linked content in whatever way you'd like. Happy developing!

Add Your Comment

Recent Entries

Into the Box Round 1 of Sessions and Workshops are now out!

Into the Box Round 1 of Sessions and Workshops are now out!

Our first round of sessions and workshops for Into the Box 2025 is here! Get ready to dive into a world of modern web development with hands-on workshops and engaging sessions led by Ortus Solutions and Community CFML and BoxLang experts. Visit intothebox.org to explore what’s in store—this is just the beginning, with much more content coming soon!

Maria Jose Herrera
Maria Jose Herrera
January 20, 2025
BoxLang 1.0.0 Beta 26 Launched

BoxLang 1.0.0 Beta 26 Launched

We’re thrilled to announce the release of BoxLang 1.0.0 Beta 26, a monumental update that takes performance and functionality to the next level. This beta officially certifies the ColdBox HMVC Framework to run on BoxLang, marking a significant milestone in compatibility. Not only can you now run all ColdBox applications seamlessly on BoxLang, but with the latest ColdBox snapshot, you can also build your entire applications in BoxLang, unlocking the full potential of this dynamic and expressive language for modern application development.

Luis Majano
Luis Majano
January 20, 2025