PyroCMS

blog:posts

{{ blog:posts }}

Display all blog posts or blog posts by category.

Attributes

The blog plugin is powered by streams, so it can take all of the parameters that the streams cycle can take except for stream, namespace, and where.

In addition the following extra parameters are available:

Name Default Required Description
category All Categories No Display posts from this category only.

Example

{{ blog:posts limit="5" offset="5" order_by="title" category="pyrocms" }}
	<h2>{{ title }}</h2>
	<p>{{ intro }} <a href="{{ url }}" title="Read more about: {{ title }}">Read more</a></p>
	<p>Written by: <a href="/users/view/{{ author_id }}">{{ user:display_name user_id=author_id }}</a></p>
{{ /blog:posts }}

blog:categories

{{ blog:categories }}

Display all blog categories available.

Attributes

Name Default Required Description
limit 10 No The maximum number of categories to display.
order-by created_on No Choose which column to sort by. (id, title, slug)
order-dir asc No The direction to sort results by. (asc, desc)

Example

<ul>
	<li><a href="/blog" class="button">All categories</a></li>
	{{ blog:categories order-by="title" limit="5" }}
	<li><a href="{{ url }}" class="button {{ slug }}">{{ title }}</a></li>
	{{ /blog:categories }}
</ul>