-
Notifications
You must be signed in to change notification settings - Fork 3
IndexField
Daniel Petutschnigg edited this page Sep 2, 2021
·
19 revisions
The IndexField provides an easy way to link to childpages of a slug or to fetch data of childpages and build cards on any page in your project. It is not possible to edit the text on these components for that job please look at our StreamField.
import {fields} from '@snek-at/jaen-pages'
import {JaenTemplate} from '@snek-at/jaen-pages/src/types'
const HomePage: JaenTemplate = () => {
return (
<fields.IndexField
fixedSlug={'pageId'}
onRender={(page) => (
return(
[...]
)
/>
)
}
HomePage.TemplateName = "HomePage"
export default HomePage
Property | Type | Required | Description |
---|---|---|---|
fixedSlug | string | no | If fixedSlug is not specified the IndexField will take the children of the current page. It allows you to decide which pages children are used. |
onRender | function | yes | renderItem allows you to build React-Components of any kind. |
Property | Type | Description |
---|---|---|
page | object | The page property gives you the page data including childpages in the form of an object |
WIP