Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const ImageMediaDataComponent : IContentComponent<ImageMediaData> = props
if (!imageUrl || imageUrl == "")
return <></>

return <Image src={imageUrl} alt={altText} placeholder="empty" width="640" height="375" />
return <Image src={imageUrl} alt={altText} placeholder="empty" sx={{ width: 1 }}/>
}

ImageMediaDataComponent.displayName = "Image from CMS"
Expand Down
6 changes: 5 additions & 1 deletion src/frontend/components/cms/page/BlogListPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
import NavigateNextIcon from '@mui/icons-material/NavigateNext'
import { useTheme } from '@mui/material/styles'
import useMediaQuery from '@mui/material/useMediaQuery'
import StructuredHtml from '@framework/foundation/cms/structuredhtml'


function isBlogPost(content: IContent) : content is BlogItemPage
{
Expand Down Expand Up @@ -90,7 +92,9 @@ export const Component : IContentComponent<BlogListPage> = ({ content, locale })
<Head><title>{metaTitle}</title></Head>
<Breadcrumbs />
<Typography variant="h1" component="h1" sx={{ textAlign: "center" }}><Editable field="heading" inline>{ title }</Editable></Typography>
<Typography variant='body1' component="div"><Editable field="mainIntro" html={ pv(content, "mainBody" ) ?? ""} inline/></Typography>

<Editable field='mainBody'><StructuredHtml propertyData={ pv(content, "mainBody" ) ?? "" } /></Editable>

<ContentArea content={ content } name="mainContentArea" />
<Grid container spacing={2} sx={{ mt: 3 }}>
<Grid item xs={12} md={4} lg={3}>
Expand Down
56 changes: 56 additions & 0 deletions src/frontend/components/cms/page/ThreeColumnLandingPage/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import type { IContentComponent } from '@optimizely/cms/models'
import { readValue as pv, prefetchContentAreaRecursive } from '@optimizely/cms/utils'
import { ThreeColumnLandingPage } from 'schema'
import { ContentArea } from '@components/shared/Utils'
import Head from 'next/head'
import React from 'react'
import Box from '@mui/material/Box'
import Grid from '@mui/material/Grid';
import { EditableField } from '@optimizely/cms/components'
import StructuredHtml from '@framework/foundation/cms/structuredhtml'
import site from 'website.cjs'

export const ThreeColumnLandingPageComponent : IContentComponent<ThreeColumnLandingPage> = props =>
{
const pageTitle = `${ pv(props.content, "name") ?? "ThreeColumnLandingPage Page" } :: ${ site.name }`

let leftCol = pv(props.content, "leftColumn") ?? 4
let centerCol = pv(props.content, "centerColumn") ?? 4
let rightCol = pv(props.content, "rightColumn") ?? 4


return <>
<Head>
<title>{ pageTitle }</title>
<style>{ pv(props.content, "css") }</style>
<meta name="x-epi-page-type" content='Optimizely Landing Page'/>
</Head>
<Grid container spacing={2}>
<Grid item xs={12}>
<ContentArea content={ props.content } name="topContentArea" />
</Grid>
<Grid item xs={12}>
<EditableField field='mainBody'><StructuredHtml propertyData={ props.content?.mainBody } /></EditableField>
</Grid>
<Grid item xs={leftCol}>
<ContentArea content={ props.content } name="leftContentArea"/>
</Grid>
<Grid item xs={centerCol}>
<ContentArea content={ props.content } name="mainContentArea"/>
</Grid>
<Grid item xs={rightCol}>
<ContentArea content={ props.content } name="rightContentArea" />
</Grid>
</Grid>
</>
}

ThreeColumnLandingPageComponent.getStaticProps = async (content, { locale, inEditMode, api, loader }) => {
return {
fallback: await prefetchContentAreaRecursive(content, [{ name: "mainContentArea" },{ name: "topContentArea" },{ name: "rightContentArea" },{ name: "leftContentArea" }], locale, inEditMode == true, undefined, api, loader)
}
}

ThreeColumnLandingPageComponent.displayName = "Three Column Landing Page"

export default ThreeColumnLandingPageComponent
52 changes: 52 additions & 0 deletions src/frontend/components/cms/page/TwoColumnLandingPage/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import type { IContentComponent } from '@optimizely/cms/models'
import { readValue as pv, prefetchContentAreaRecursive } from '@optimizely/cms/utils'
import { TwoColumnLandingPage } from 'schema'
import { ContentArea } from '@components/shared/Utils'
import Head from 'next/head'
import React from 'react'
import Box from '@mui/material/Box'
import Grid from '@mui/material/Grid';
import { EditableField } from '@optimizely/cms/components'
import StructuredHtml from '@framework/foundation/cms/structuredhtml'
import site from 'website.cjs'

export const TwoColumnLandingPageComponent : IContentComponent<TwoColumnLandingPage> = props =>
{
const pageTitle = `${ pv(props.content, "name") ?? "TwoColumnLandingPage Page" } :: ${ site.name }`

let leftCol = pv(props.content, "leftColumn") ?? 6
let rightCol = pv(props.content, "rightColumn") ?? 6


return <>
<Head>
<title>{ pageTitle }</title>
<style>{ pv(props.content, "css") }</style>
<meta name="x-epi-page-type" content='Optimizely Landing Page'/>
</Head>
<Grid container spacing={2}>
<Grid item xs={12}>
<ContentArea content={ props.content } name="topContentArea" />
</Grid>
<Grid item xs={12}>
<EditableField field='mainBody'><StructuredHtml propertyData={ props.content?.mainBody } /></EditableField>
</Grid>
<Grid item xs={leftCol}>
<ContentArea content={ props.content } name="mainContentArea"/>
</Grid>
<Grid item xs={rightCol}>
<ContentArea content={ props.content } name="rightContentArea" />
</Grid>
</Grid>
</>
}

TwoColumnLandingPageComponent.getStaticProps = async (content, { locale, inEditMode, api, loader }) => {
return {
fallback: await prefetchContentAreaRecursive(content, [{ name: "mainContentArea" },{ name: "topContentArea" },{ name: "rightContentArea" }], locale, inEditMode == true, undefined, api, loader)
}
}

TwoColumnLandingPageComponent.displayName = "Two Column Landing Page"

export default TwoColumnLandingPageComponent
2 changes: 2 additions & 0 deletions src/frontend/components/cms/page/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export const CmsPageComponents : Record<string, ComponentType> = {
"page/FolderPage": dynamic(() => import("./FolderPage"), { ssr: true }),
"page/HomePage": dynamic(() => import("./HomePage"), { ssr: true }),
"page/LandingPage": dynamic(() => import("./LandingPage"), { ssr: true }),
"page/TwoColumnLandingPage":dynamic(() => import("./TwoColumnLandingPage"), { ssr: true }),
"page/ThreeColumnLandingPage":dynamic(() => import("./ThreeColumnLandingPage"), { ssr: true }),
"page/LocationItemPage": dynamic(() => import("./LocationItemPage"), { ssr: true }),
"page/LocationListPage": dynamic(() => import("./LocationListPage"), { ssr: true }),
"page/StandardPage": dynamic(() => import("./StandardPage"), { ssr: true }),
Expand Down
Binary file modified src/frontend/public/favicon.ico
Binary file not shown.