Blog-plugin: How to display blogPosts list on the homepage (root / of the site)?

Created on 25 Sep 2016  路  1Comment  路  Source: rainlab/blog-plugin

Hi, I'm trying to get my blogPosts list on the homepage of my OctoberCMS site (the root of the website, i.e. /). The URL of my blog page is : /blog/:page?. When I go to the root /. How can I get the blogPosts list on my homepage (i.e. root /) please?

Question

Most helpful comment

You can add Blog posts component to your page (or layout, or partial) and inside this page, you can access blogPosts object.

_How to add component is here, 5:41_

In page, you can render posts like this:

{% for post in blogPosts.posts %}

<h5>{{post.title}}</h5>

<p>{{post.content_html|raw}}</p>

{% endfor %}

>All comments

You can add Blog posts component to your page (or layout, or partial) and inside this page, you can access blogPosts object.

_How to add component is here, 5:41_

In page, you can render posts like this:

{% for post in blogPosts.posts %}

<h5>{{post.title}}</h5>

<p>{{post.content_html|raw}}</p>

{% endfor %}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

m49n picture m49n  路  4Comments

drmzio picture drmzio  路  8Comments

rowild picture rowild  路  4Comments

daveharrisonnet picture daveharrisonnet  路  9Comments

marcomessa picture marcomessa  路  7Comments