Download the complete example
Download the editor blog workspace to compare the finished blocks, fields, page types, and content with this guide. Extract the ZIP into its own folder. After installingprimo-cli, run from the extracted folder:
primo dev --author cms. The included README explains the field connections and differences from the browser tutorial. Use a copy if you want to keep the original example.
Prerequisites
You need developer access to a site and familiarity with fields and page types.Create the blog
1
Define the Blog Post page type
Add
title (Text), excerpt (Text), publish_date (Date), and body (Rich Text) page fields. Use an Info field to explain the expected content. A Date field does not schedule publication.2
Build a Post Content block
Add Page Field references named
title, publish_date, and body, pointing to the corresponding Blog Post fields. Paste this code:component.svelte
3
Set the post template
Add navigation to the header, Post Content to the starting body, and a footer to the footer slot. Leave available blocks empty for a fixed post layout. Editors fill in page fields rather than rearranging the post.
4
Create the index
Create a Blog page with slug Enable Post List on the Blog page’s type and add it to that page. Page List returns all pages of its configured type; it does not filter by a publication date or let editors select posts.
blog using a page type with a flexible body, such as a General Page type you create. Build a Post List block with a Page List field named posts, restricted to Blog Post:component.svelte
5
Create and verify a post
Create a child of Blog using the Blog Post type, with slug
first-post. Fill in its page fields. Confirm /blog/first-post appears in the index and uses the fixed post layout.6
Publish and hand off
Save open dialogs and publish the site. Check the public index and post URL, then invite a Content Editor and have them create a second post.
Add SEO tags to the page type’s Head HTML if you want page fields to populate search metadata. Field names alone do not generate title or description tags.