profound-logoProfound CMS
⌘K
Admin
Theme
DocsTutorialBlogPhilosophy
DocsTutorialBlogPhilosophy

Hybrid

Collection of Pages with ComponentsTypes of ComponentsSetup server sent events (SSE) content refetchInstall Profound CMS as a proxyCEL Scripting in Template BuilderProject ScaffoldingMedia Library

Headless

Quick startJSON 与 Claude 代码组件 Zod 拉取

REST API

REST API 概览get连接网站 APIgetGET /routesgetGET /routegetGET /blocksget获取带有 CEL 缓存的区块getGET /blocks/generatedgetGET /componentsgetGET /components/{name}getGET /dataset/{schema_name}get获取内容变更 SSEpatchPATCH /dataset/{schema_name}postPOST /translationpatchPATCH /translationsgetGET /usagepostPOST /csvpatch修补 CSV
All Systems Operational
Powered Byprofound-logo
Theme

Collection of Pages with Components

参数化路由允许你在同一个 URL 下封装多个页面

参数化页面

参数化页面允许你在同一个 URL 下封装多个页面。

/{country}/landingPage   // 考虑国家的着陆页
/{lang}/products        // 面向多种语言的产品列表页
/{categories}/{blogPost} // 按类别区分的自定义博客文章

参数化页面的工作方式如下:

  • 将自定义组件连接到 {country} 或 {lang} 这样的 slug,或者你选择的任何 slug,例如 {categories}
  • 对于像 {categories} 这样的自定义 slug,所连接的组件必须在组件构建器中定义一个“Route Slug”
  • 你在该模式中创建文档,以动态生成多个页面

步骤 1:设置参数化路由

在管理面板中创建一个参数化路由:/{country}/landingPage

然后将 {country} slug 连接到 Country 模式。

“No default slug field configured for this component” 警告表示系统尚不清楚应使用哪个模式字段作为 URL slug。我们将在下一步解决这个问题。


步骤 2:创建模式和文档

在 CMS 中创建一个 Country 模式。

示例结构:

{
  "code": "us",
  "name": "United States",
  "language": "English"
}

假设你在此模式中目前有 3 个文档。


步骤 3:将字段绑定到路由 Slug

前往 Country 模式 → 编辑模式

将 code 字段绑定为 路由 Slug 字段。

这意味着有效路由将是:/us/landingPage

无效路由:

  • /English/landingPage
  • /United States/landingPage

结果

  • 每个文档都会创建一个新页面
  • 3 个文档 = 3 个着陆页
  • 添加更多文档会自动创建更多路由

下一步

请参阅 设置参数化路由 与渲染器配合渲染参数化页面

Continue Reading
NextTypes of Components›