Permalink
Browse files

Add related posts to sidebar

  • Loading branch information...
paltman committed Feb 17, 2015
1 parent 4cd35fa commit 1ae8a0eeff7bf39b07462876ab0d5533a69997ec
Showing with 19 additions and 0 deletions.
  1. +19 −0 ppb/templates/pinax/blog/blog_post.html
@@ -25,3 +25,22 @@ <h1>{{ post.title }}</h1>
</div>
</div>
{% endblock %}
{% block sidebar %}
{{ block.super }}
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">Releated Posts</h2>
</div>
<div class="list-group">
{% for related in post.tags.similar_objects %}
<div class="list-group-item">
<a href="{{ related.get_absolute_url }}">{{ related.title }}</a>
<br />
<small class="text-muted">{{ related.published }}</small>
</div>
{% endfor %}
</div>
</div>
{% endblock %}

0 comments on commit 1ae8a0e

Please sign in to comment.