contentPage
Fetch a content page by path, e.g. an About Us or Terms & Conditions page. Its body is a list of blocks, so select the members of the Block union the project registers.
Arguments
| Argument | Type | Description |
|---|---|---|
version | ContentVersionType | |
path | String! | |
previewId | String |
Returns
| Field | Type | Description |
|---|---|---|
id | ID! | Unique identifier for the content page. |
name | String! | Name of the content page. |
heading | String! | Text of the page's one top-level heading, which the page renders itself. |
headingVisible | Boolean! | False keeps the H1 for search engines and screen readers but hides it, for a page whose first block opens it, such as a home page with a campaign banner. |
path | String! | URL path of the content page. |
translatedPaths | [TranslatedPath!] | List of translated paths for different locales. |
breadcrumbs | [Breadcrumb!] | Breadcrumb trail for the content page. |
meta | PageMeta | Page metadata for SEO and other purposes. |
intro | String | The text below the heading. |
leadImage | ContentAsset | The image below the heading, with no text on it; also the card image in a list and the fallback for the SEO image. |
body | [Block] | Main content body of the page, composed of various block types. |
categories | [ProductCategory!]! | The product categories the page is about. A product shows the page among its articles when its primary category, or one of that category's ancestors, is among them. |
Example
query ContentPage( $version: ContentVersionType $path: String! $previewId: String) { contentPage(version: $version, path: $path, previewId: $previewId) { id name heading headingVisible path translatedPaths { locale path } breadcrumbs { name path type } meta { title description } intro leadImage { alt filename name isExternalUrl title } body { __typename ... on RichText { id document } ... on ArticleList { id anchor audience title } ... on BrandList { id anchor audience title } } categories { id key name path description productCount } }}{ "version": "DRAFT", "path": "/example", "previewId": "Example"}{ "data": { "contentPage": { "id": "id-1", "name": "Example", "heading": "Example", "headingVisible": true, "path": "/example", "translatedPaths": [ { "locale": "Example", "path": "/example" } ], "breadcrumbs": [ { "name": "Example", "path": "/example", "type": "CATEGORY" } ], "meta": { "title": "Example", "description": "Example" }, "intro": "Example", "leadImage": { "alt": "Example", "filename": "Example", "name": "Example", "isExternalUrl": true, "title": "Example" }, "body": [ { "__typename": "RichText", "id": "id-1", "document": {} } ], "categories": [ { "id": "id-1", "key": "Example", "name": "Example", "path": "/example", "description": "Example", "productCount": 1 } ] } }}The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.
Used by
The storefront packages that send it, in these GraphQL documents:
- @evolve-storefront/feature-content-blocks:
ContentBlocksGetContentPage

