sruupl / batflat

Lightweight, fast and easy CMS for free. Bootstrap ready. https://batflat.org
MIT License
135 stars 53 forks source link

Issue with Blog Posts loop #92

Open sunalive opened 3 years ago

sunalive commented 3 years ago

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.

keesversluis commented 3 years ago

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?

sunalive commented 3 years ago

That's right.