Blog Details Component: The dynamicPageItem Discovery
After fixing the content loading issue in all Agility components, I was still getting 'Page Not Found' errors on blog post detail pages. The issue was in the BlogDetails component - it was trying to find the blog post using complex logic when Agility CMS was already providing the blog post directly.
Blog Details Component: The dynamicPageItem Discovery
Date: January 6, 2026
Author: Joel Varty (with technical details by Cursor AI Agent)
The Problem
After fixing the content loading issue in all Agility components, I was still getting "Page Not Found" errors on blog post detail pages like /blog/why-i-love-football. The console showed that getAgilityPageProps was being called successfully, but the page wasn't rendering.
The issue was in the BlogDetails component - it was trying to find the blog post using complex logic involving sitemapNode.contentID and slug matching, when Agility CMS was already providing the blog post directly.
The Solution
For dynamic pages in Agility CMS, the content item that the page references is already available as dynamicPageItem in the UnloadedModuleProps. No need to fetch it separately!
The fix was simple:
// ✅ CORRECT - Use dynamicPageItem directly
const BlogDetails = async ({ module, languageCode, dynamicPageItem, page }: UnloadedModuleProps) => {
// ... fetch module config ...
let post: BlogPost | null = null
// For dynamic pages, the blog post is available as dynamicPageItem
if (dynamicPageItem) {
post = dynamicPageItem as unknown as BlogPost
}
// Fallbacks for static pages...
}
Additional Fixes
While fixing this, I also discovered and fixed:
-
Slug field name inconsistency - The
BlogListingcomponent was usingpost.fields.slug(lowercase) but the actual field name in Agility CMS isSlug(capitalized). -
Interface mismatch - The
BlogPostinterface inBlogListinghadslug: stringbut should have beenSlug: stringto match the actual CMS field.
Visual Reference: Blog Post in Agility CMS

This screenshot shows how the markdown content field supports rich formatting and custom gallery syntax.
Lesson Learned
When working with Agility CMS dynamic pages:
- Check
dynamicPageItemfirst - It's already there, no need to fetch! - Field names are case-sensitive - Match exactly what's in Agility CMS
- Keep it simple - Agility CMS provides what you need, don't overcomplicate it
Joel's Thoughts / Reflections
[Space for Joel to add personal thoughts, reactions, design decisions, or creative direction]