The Blog Injector plugin can be used with these two awesome frameworks:

  • Pure grids
  • Bootstrap

By default, it is configured to use the Pure framework. This option can be easily changed from the Admin panel or by hand.

When you need to configure the plugin by hand, simply copy the blog-injector.yaml file under the user/config/plugins folder. If that folder does not exist, just create it.

The plugin configuration is defined by two options:

framework: pure
add_framework_assets: true

The framework option sets the framework to use, while the add_framework_assets option automatically adds the framework assets to the web site, when it is set to true.

Each framework comes with three twig templates:

  • blog.html.twig
  • item.html.twig
  • blog_theme.html.twig

The blog.html.twig renders the blog items list, while the item.html.twig renders the current blog item. These templates must be included in your theme, respectively to render the blog posts list and the single post. The blog_theme.html.twig template defines the chunks required to render the entire blog component.

To add the blog posts list, create a template in your theme, usually called blog.html.twig, and include the blog plugin template as follows:

{% include 'blog/' ~ framework ~ '/blog.html.twig' %}

To add the blog post, create a template in your theme, usually called item.html.twig, and include the blog plugin template as follows:

{% include 'blog/' ~ framework ~ '/item.html.twig' %}