Get LaunchBase

Blog Thumbnail Component!

Connected Cloud

Connected Cloud

Building Connected Clouds and Accelerating SaaS Startups

Read
# note: to use this component you must add latest_blogs to the view context.

# view
latest_blogs = Blog.objects.order_by('-timestamp')[:2]
context['latest_blogs'] = latest_blogs

# template
{% for blog in latest_blogs %}
        {% with post_id=blog.id post_title=blog.title post_date=blog.timestamp|date:"F j, Y" 
            post_description=blog.description post_link="/blog/"|add:blog.id post_image=blog.thumbnail %}
            {% include "blog/blog_thumbnail.html" %}
        {% endwith %}
{% endfor %}