@larissa
In OctoberCMS, you can list related blog posts by utilizing the RainLab.Blog plugin and customizing your theme accordingly. Here is a step-by-step guide:
1 2 3 4 5 6 7 8 9 10 |
<div class="related-posts">
{% if relatedPosts|length %}
<h4>Related Posts:</h4>
<ul>
{% for post in relatedPosts %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
</div>
|
This code generates an unordered list of related blog post links. Customize the HTML structure and CSS class names as per your theme requirement.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[...]
description: My OctoberCMS Theme
author: Your Name
...
sections:
[...]
blogPost:
type: blogPost
[...other configuration options...]
related_posts:
name: Related Posts
description: Display related posts at the bottom of the post.
[...]
|
1
|
{% partial "related_posts" relatedPosts=post.relatedPosts %}
|
Now, the related blog posts will be displayed at the bottom of each blog post, appearing as a list of links.