Landing Page

1 Object type • 1 demo Object

Follow the steps below to install this Block. Make sure you have reviewed the getting started steps.
This will create the pages Object type in your Bucket and add demo content.
This will add the files Hero.tsx, Sections.tsx, and Section.tsx to your blocks folder located in cosmic/blocks/landing-page.
Import the block into your app.
Add the Block to your app with the `query` property set to fetch your specific content. Read more about queries in the docs.
Import the block into your app.
Add the Block to your app with the `query` property set to fetch your specific content. Read more about queries in the docs.

Examples

You can add a hero and sections to your home page by updating the file at app/page.tsx with the following:
You can create dynamic pages by creating a new file at app/[slug]/page.tsx with the following:
Go to Bucket > Objects > Pages and add new pages. For example create a new Page with title Features and slug features and see it available at https://localhost:3000/features
Enable draft preview by setting the status property on the Block. View the draft preview content by setting the ?status=any in the URL. Note: This is a basic example. It is advisable to consider a security strategy if you intend to keep your preview private.
To add the draft preview link in the dashboard, go to Pages Object type > Settings and add your preview link in the dashboard under Additional Settings. For example adding the link http://localhost:3000/[object_slug]?status=any will add a Preview button to each page.
First, enable localization in the dashboard by going to Page Object type > Settings under Additional Settings. Then set the locale on your specific Object. Finally, pass the locale parameter into the query to fetch your localized content. Create a new file at app/[...slug]/page.tsx with the following. Then go to any page with localization set, for example: https://localhost:3000/es/features or https://localhost:3000/en/features.
footer logo