Skip to content

Blog ​

Posts with categories, an author, a publish date and an optional expiry, written with the block editor. The module adds a posts block for list pages and gives every post its own URL.

  • Module key blog
  • Default on
  • Switch EVOLVE_MODULE_BLOG, see Modules
  • Role access evolve.roles.modules.blog
  • Panel /evolve/blog/post, /evolve/blog/category

Configuration ​

VariableDefaultPanelEffect
BLOG_ALLOW_BLOCKStruenoShow the block editor on posts. Off, a post has only its fields and intro.
BLOG_PAGINATION_PER_PAGE6noPosts per page in the built-in list route.
BLOG_OVERVIEW_PAGEunsetyesID of the CMS page that carries the posts block. The built-in list route redirects there.
BLOG_AUTHOR_TYPEuseryesWhere author information comes from: user for panel users, company for members of the Company module.
BLOG_ROUTE_PREFIXnewsnoURL segment of post detail pages, /{locale}/news/{slug}.

"Panel" marks the keys the Settings screen edits. The others are set in the .env or in a published config/blog.php.

In the panel ​

  • Posts at /evolve/blog/post: title, slug, intro, category, author, publish date, "valid to" date, featured flag, active flag, layout, and the block editor. Inactive posts and posts past their "valid to" date are not shown on the site.
  • Categories at /evolve/blog/category.
  • Cmd-K: "Posts", "Categories" and "New post" (also found with "article" or "Artikel"). Posts are part of the global search.

The posts list of the Blog module

On the site ​

  • Posts block ("Alle Beiträge", blog.posts): title, intro text, an optional category filter, and the choice between all posts and featured posts. The list loads through Livewire and pages through api/blog/post.
  • Detail pages at /{locale}/news/{slug}. The head carries the post's meta tags, including article:author.
  • Built-in list route /{locale}/blog, paged with BLOG_PAGINATION_PER_PAGE. With BLOG_OVERVIEW_PAGE set it redirects to that page instead.

The usual setup: create a page, add the posts block, set BLOG_OVERVIEW_PAGE to that page in Settings.

Publishing ​

TagPublishes
blog.configconfig/blog.php
blog.componentsthe block definition to config/components/, the Livewire components and frontend views
blog.blueprintsBlogPosts.php to app/Blueprints

Publish only to change something. A published view no longer follows package updates.

Verifying ​

Create a post, set it active with a publish date in the past, and open /{locale}/news/{slug}. php artisan route:list --path=blog lists the panel and frontend routes.