Rendering Pages
Fetch and display dynamic pages on your storefront.
Updated
On this page
Overview
Render content type items on your storefront using the SDK and your own components.
Dynamic Pages
// app/[...slug]/page.tsx
import dash from "@/lib/dash"
export default async function DynamicPage({ params }) {
const path = "/" + params.slug.join("/")
const page = await dash.pages.getByPath(path)
if (!page) return <div>Page not found</div>
return (
<div>
<h1>{page.page.title}</h1>
<div dangerouslySetInnerHTML={{ __html: page.page.content }} />
</div>
)
}