How do I expand page content using collection data?

Learn how to use collections to extend and enrich your page content — for example, adding author details to blog posts.

Introduction

In this guide, you’ll learn how to extend your page or blog content using collection data.
We’ll walk through an example of expanding a blog post to include detailed author information such as an avatar, name, and bio — all managed through a collection.

This approach allows you to connect different types of content and make your pages more dynamic and data-driven.


Create an Authors collection

Start by creating a new collection in your project dashboard.

  1. Navigate to the Collections section in your Blutui dashboard.
  2. Click Create collection and name it Authors.
  3. Add the following fields:

Field TypeNameDescription
TexthandleA unique identifier for each author (e.g. frodo-baggins)
TextAuthor NameThe display name of the author
FileavatarThe author’s profile image
RichtextbioA short author biography

After saving the collection, create your first entry:

FieldExample Value
handlefrodo-baggins
Author NameFrodo Baggins
avatar(upload an image)
bio“Ring-bearer and adventurer from the Shire.”

Reference the author in a blog post

Next, open one of your blog posts (or create a new one) and fill in the author field with the author’s handle — in this case:


frodo-baggins

This will link the blog post to the matching entry in your Authors collection.


Connect the author data in your template

Now, let’s connect your blog post to its author data inside your Canvas template.

At the top of your blog post template, set and filter the collection to find the correct author:

{% set authors = cms.collection('authors') %}
{% set author = authors | filter(v => v.handle == post.author) | first %}

This retrieves the authors collection and filters it by the handle value matching the blog post’s author field.


Display the author information

Once you’ve set the author variable, you can display the author’s details anywhere in your post template. Typically, this is shown at the bottom of the blog post.

<div class="author-section">
  <img
    src="{{ author.avatar }}"
    alt="{{ author.name }}"
  >
  <p>
    <strong>{{ author.name }}</strong>
  </p>
  <div>
    {{ author.bio | raw }}
  </div>
</div>

This will render the author’s avatar, name, and biography directly from the collection data.


Extend this approach further

You can use this same pattern to expand your pages with other types of related content, such as:

  • Linking locations to events
  • Displaying categories or tags for posts
  • Showing related products or team members based on handles or URLs

By using collections, you can connect data across your site and make your content more flexible and scalable.


Next steps

Now that you’ve connected a collection to your page content, explore ways to make it even more dynamic — such as using loops, filters, or relational structures to build complex data relationships.

Last updated on