batflat icon indicating copy to clipboard operation
batflat copied to clipboard

Issue with Blog Posts loop

Open sunalive opened this issue 4 years ago • 2 comments

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.

sunalive avatar Sep 17 '20 06:09 sunalive

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?

keesversluis avatar Oct 28 '20 13:10 keesversluis

That's right.

sunalive avatar Nov 13 '20 18:11 sunalive