Landing Page
This function retrieves a landing page based on the given pk . It includes the page content, visuals, campaign blocks, and custom components.
The getLandingPageData function is imported from '@akinon/next/data/server'
.
import { getLandingPageData } from '@akinon/next/data/server';
This function can be used like this:
import { getLandingPageData } from '@akinon/next/data/server';
import { withSegmentDefaults } from '@akinon/next/hocs/server';
import { PageProps } from '@akinon/next/types';
async function Page({ params }: PageProps<{ pk: number }>) {
const data = await getLandingPageData({ pk: params.pk });
const content = data.landing_page;
return (
<div className="container mx-auto py-6">
<div className="mx-auto prose prose-headings:text-primary">
Landing page {JSON.stringify(content)}
</div>
</div>
);
}
export default withSegmentDefaults(Page, {
segmentType: 'page'
});
Last updated
Was this helpful?