Readme.rst 603 B

1234567891011121314151617181920
  1. Related posts
  2. -------------
  3. This plugin adds the ``related_posts`` variable to the article's context.
  4. By default, up to 5 articles are listed. You can customize this value by
  5. defining ``RELATED_POSTS_MAX`` in your settings file::
  6. RELATED_POSTS_MAX = 10
  7. You can then use the ``article.related_posts`` variable in your templates.
  8. For example::
  9. {% if article.related_posts %}
  10. <ul>
  11. {% for related_post in article.related_posts %}
  12. <li><a href="{{ SITEURL }}/{{ related_post.url }}">{{ related_post.title }}</a></li>
  13. {% endfor %}
  14. </ul>
  15. {% endif %}