Model Parent-Child Relationships

Create ownership relationships where child resources belong to a parent — comments to articles, order items to orders. Unlike flexible references, strict reference means children can't exist without their parent, and your API URLs reflect the hierarchy automatically.


What is Strict Reference?

Strict reference creates a parent-child relationship between folders where:

  • Each child resource belongs to exactly one parent resource
  • Child resources are managed through the parent rather than directly
  • The Flux API URL structure reflects the hierarchy automatically

Common use cases include:

  • Comments belonging to articles
  • Order items belonging to orders
  • Chapters belonging to books
  • Variants belonging to products

Prerequisites

Before creating a strict reference folder, you need:

  • A parent collection folder with at least one published resource. See Create Folders in the Dashboard.
  • Appropriate permissions to manage folders in the target environment.

Step 1 – Create the Child Folder

  1. Open your environment in the FoxNose dashboard.
  2. Click Database in the sidebar.
  3. Navigate to the parent folder (e.g., Articles).
  4. Click Add subfolder to create a nested folder.
Create folder dialog showing Comments folder with strict reference enabled
  1. Configure the folder:
FieldDescriptionExample
Folder NameDisplay name for the folderComments
Folder AliasURL-safe identifiercomments
Strict ReferenceEnable the checkbox to create parent-child relationship✓ Checked
  1. Click Create folder.

Step 2 – Define the Child Schema

After creating the folder, define its schema:

  1. Switch to the Schema tab in the new folder.
  2. Add fields for your child content (e.g., body for comment text).
  3. Click Publish version to activate the schema.

The child folder now has its own schema, independent of the parent, but resources will be linked through the strict reference relationship.


Step 3 – Add Child Resources

With strict reference enabled, you cannot add resources directly to the child folder. Instead, you add them through the parent resource:

  1. Navigate to the parent folder (Articles).
  2. Open a parent resource (e.g., an article).
  3. Look for the Related resources tab — this only appears when strict reference children exist.
Article editor showing Related resources tab with Comments section
  1. Click Add related resource under the child folder section.
Comment editor showing the Owned by indicator linking to parent article
  1. Fill in the child resource fields and save.

Notice the "Owned by" indicator at the top of the editor — this shows which parent resource owns this child.


Step 4 – Connect to Flux API

When you connect a strict reference folder to a Flux API, the URL structure automatically reflects the hierarchy:

  1. Go to Delivery → Flux API in the sidebar.
  2. Select your API or create one.
  3. Connect the child folder (Comments) using the Connected Folders tab.
Flux API endpoints showing nested URL structure for Comments

The endpoints follow a nested structure that includes the parent resource key:

EndpointDescription
/{prefix}/{parent}/{parent_key}/{child}List all child resources
/{prefix}/{parent}/{parent_key}/{child}/_searchSearch child resources
/{prefix}/{parent}/{parent_key}/{child}/{key}Get specific child resource

For example, with prefix content, parent articles, and child comments:

GET /content/articles/{articles_key}/comments              → List comments for an article
POST /content/articles/{articles_key}/comments/_search     → Search comments for an article
GET /content/articles/{articles_key}/comments/{comments_key} → Get specific comment

Step 5 – View and Manage Child Resources

After creating child resources, they appear in the parent's Related resources tab with the resource count.

Related resources tab showing Comments with 1 resource and View all button

From this tab you can:

  • See the count of related resources for each child folder
  • Click Add related resource to create more children
  • Click View all to open the child folder filtered by this parent

When you click View all, you're taken to the child folder with an automatic filter applied:

Comments folder showing resources filtered by parent article

The filter badge shows which parent resource owns the displayed children. This makes it easy to manage all comments for a specific article without seeing comments from other articles.


API Response Structure

When fetching child resources, the response includes the parent reference:

{
  "results": [
    {
      "_sys": {
        "key": "cmt_abc123",
        "folder": "comments",
        "parent": {
          "key": "art_xyz789",
          "folder": "articles"
        }
      },
      "data": {
        "body": "Great article, very helpful!"
      }
    }
  ]
}

The _sys.parent field identifies which parent resource owns each child.


Best Practices

  • Use strict reference for true ownership — When child content has no meaning without the parent (comments without article, order items without order).
  • Use regular references for associations — When resources can exist independently but relate to each other (articles referencing categories).
  • Plan your hierarchy depth — Strict reference supports one level of nesting. For deeper hierarchies, consider using regular references.

What You've Learned

You now understand both ways to connect content in FoxNose:

RelationshipUse CaseURL Structure
ReferenceAssociations (author → user)Flat, use populate
Strict ReferenceOwnership (comment → article)Nested under parent

Next Step

Your content model is complete. Now let's learn to query it effectively — search, filter, and retrieve exactly the data you need.

Was this page helpful?