batflat
batflat copied to clipboard
Issue with Blog Posts loop
Hi,
I'm trying to add Blog posts list into my index.html (of my theme) where the following code (copied from the basic theme) for blog list is in a sub-page (inc/blogs.html) which is pulled into index.html in a div. However it doesn't seem to populate anything. The only time blog list works is when it is selected as the Homepage in the Settings page. The latest posts list works fine, only the blog posts does not. Can you see what could be the issue?
{loop: $blog.posts}
<div class="col-sm-4 sm-margin-b-50">
{if: $value.cover_photo}
<div class="margin-b-20">
<img class="img-responsive" src="{$value.cover_url}" alt="{$value.title}">
</div>
{/if}
<h4><a href="{$value.url}">{$value.title}</a> <span class="text-uppercase margin-l-20">Management</span></h4>
<p>{$value.content}</p>
<a class="link" href="{$value.url}">{$lang.blog.readmore}</a>
</div>
{/loop}
Thanks.
It appears that the variable $.blog.posts is only available on the blog.html page. Not even on the post.html page. Am I right?
That's right.