anomaly.module.posts
The Posts Module provides a flexible blogging and article management system with categories, tags, and multiple post types.
- Post management
- Category organization
- Tag support
- Multiple post types
- Draft & scheduling
- Featured posts
- RSS feeds
- SEO optimization
useAnomaly\PostsModule\Post\Contract\PostRepositoryInterface;
$posts = app(PostRepositoryInterface::class);
// Get all posts$allPosts = $posts->all();
// Get published posts$published = $posts->findAllPublished();
// Get post by slug$post = $posts->findBySlug('my-article');
// Get posts by category$posts = $posts->findByCategory($category);{# List posts #}
{% forpostin posts().published().get() %}
<article>
<h2><ahref="{{ post.path }}">{{ post.title }}</a></h2>
<p>{{ post.summary }}</p>
<time>{{ post.publish_at|date('F j, Y') }}</time>
</article>
{% endfor %}
{# Display single post #}
<article>
<h1>{{ post.title }}</h1>
<time>{{ post.publish_at|date('F j, Y') }}</time>
<div>{{ post.content|raw }}</div>
{# Categories & Tags #}
{% forcategoryinpost.categories %}
<span>{{ category.name }}</span>
{% endfor %}
{% fortaginpost.tags %}
<span>{{ tag.name }}</span>
{% endfor %}
</article>
{# Recent posts #}
{% forpostin posts().published().orderBy('publish_at', 'desc').limit(5).get() %}
<ahref="{{ post.path }}">{{ post.title }}</a>
{% endfor %}{# All categories #}
{% forcategoryin categories().get() %}
<ahref="{{ url_route('anomaly.module.posts::category', [category.slug]) }}">
{{ category.name }}
</a>
{% endfor %}
{# All tags #}
{% fortagin tags().get() %}
<ahref="{{ url_route('anomaly.module.posts::tag', [tag.slug]) }}">
{{ tag.name }}
</a>
{% endfor %}- Streams Platform ^1.10
- PyroCMS 3.10+
The Posts Module is open-sourced software licensed under the MIT license.