Skip to documentation content

Blog or Datastore

Blog or Datastore

A blog should almost always be a Blog with BlogPosts rather than a datastore whose items have pages: what each object already provides, and when a datastore is the better home.

A blog should almost always be a Blog with BlogPosts rather than a datastore whose items have pages. This is a strong consideration, not a prohibition, and the reason is what each object already provides:
• A BlogPost has a post date, summary, body, featured image, tags, and authors built in, and the Blog is itself the page at its URL. A datastore item has only the fields you define, so a datastore blog redefines all of those, then needs a listing template that rebuilds what {% blog_posts %} already does: filter by blog, tag, author, and a date range, and order by post_date.
• Blog, BlogPost, and {% blog_posts %} are designed together, and the blog scenarios show the whole set; a datastore replaces them with templates you maintain.
A datastore is the better home for records that are not posts (locations, job openings, products), even when a listing orders them by date. If you choose a datastore for post-like content anyway, record why.
The /blog menu item should link to the Blog itself, which is the landing page, not to a separate listing Article. To build the pages, see the blog_posts method, the topics Obtain a Collection and Blog Post, and the Blog Page and Blog Post Page complete examples.