Hello community. I have integrated a custom html5 bootstrap template to my Frappe and it’s going well. I’m stuck at displaying Blog Posts like in the default homepage that comes with Frappe and ERPNext. I have copied the html code from erpnext/erpnext/templates/includes/home.html:
<section class="container my-5">
<h3>{{ _('Publications') }}</h3>
<div class="row">
{% for blog in blogs %}
<div class="col-md-4 mb-4">
<div class="card h-100">
<div class="card-body">
<h5 class="card-title">{{ blog.title }}</h5>
<p class="card-subtitle mb-2 text-muted">{{ _('By {0}').format(blog.blogger) }}</p>
<p class="card-text">{{ blog.blog_intro }}</p>
</div>
<div class="card-body flex-grow-0">
<a href="{{ blog.route }}" class="card-link">{{ _('Read blog') }}</a>
</div>
</div>
</div>
{% endfor %}
</div>
</section>
as well as from the home.py:
import frappe
def get_context(context):
context.blogs = frappe.get_all('Blog Post',
fields=['title', 'blogger', 'blog_intro', 'route'],
filters={
'published': 1
},
order_by='modified desc',
limit=3
)
Somehow it does not show on my custom template, what am I missing?