{"title":"Cms ContentPages Controller - Liquid Controller Reference","slug":"cms-content-pages-controller-reference","url":"https://support.storeconnect.com/articles/cms-content-pages-controller-reference","url_markdown":"https://support.storeconnect.com/articles/cms-content-pages-controller-reference.md","subtitle":null,"summary":"The CMS ContentPages Liquid controller renders content pages and supports in-editor previews via the `home` and `render_page_with_editor` GET actions.","type":"Developer_Documentation","video_url":"","keywords":"liquid, controllers, Cms ContentPages, storefront, storeconnect","last_modified":"2026-08-21T07:12:35+0000","body_markdown":"## Description\n\nThe Cms ContentPages controller handles requests related to cms contentpages functionality in your StoreConnect storefront.\n\n| Property | Value |\n|----------|-------|\n| **Controller** | `ContentPagesController` |\n| **Liquid Template Path** | `controllers/cms/contentpages/` |\n| **Namespace** | Cms |\n\n## Actions\n\n| Action | HTTP Method | Route | Liquid Page |\n|--------|-------------|-------|-------------|\n| `home` | GET | `/cms/contentpages/home` | — |\n| `render_page_with_editor` | GET | `/cms/contentpages/render-page-with-editor` | — |\n\n## Liquid Controller Lifecycle\n\nFor each action, Liquid controller templates are executed in three phases:\n\n1. **Before** — `controllers/cms/contentpages/{action}.liquid` runs before the Rails action\n2. **After** — runs after the Rails action but before the response is sent\n3. **Final** — runs after the response, useful for cleanup\n\n## Available Liquid Tags\n\nInside controller templates, these tags are available:\n\n| Tag | Description |\n|-----|-------------|\n| `{% params %}` | Set request parameters (e.g. `{% params foo: \"bar\" %}`) |\n| `{% variables %}` | Set template variables (e.g. `{% variables title: \"Hello\" %}`) |\n| `{% respond %}` | Respond with custom content, alert, or notice |\n| `{% redirect %}` | Redirect the request (e.g. `{% redirect to: \"/products\" %}`) |\n| `{% action %}` | Execute a server-side action (e.g. `{% action \"cart.add\" %}`) |\n\n## Example\n\nCreate a file at `controllers/cms/contentpages/home.liquid`:\n\n\n```liquid\n\n{% before %}\n  variables custom_heading: \"Welcome\"\n{% endbefore %}\n```\n"}