Trying to show all posts except featured - Error 400

I’m tying to mask featured posts from the bottom part of the page with Alto theme.

So i added this line in index.hbs, just before the “foreach post” instructions.

{{#get "posts" filter="featured:false" limit="all"}}

Here is the full index.hbs page :

{{!< default}}

<div class="content-area">
<main class="site-main">

    <div class="post-feed">
        {{#get "posts" filter="featured:false" limit="all"}}
            {{#foreach posts}}
                {{> "loop"}}
            {{/foreach}}
    </div>

    {{pagination}}

</main>
</div>

However, i got this error [index.hbs] Parse error on line 16: …on}} --------------------^ Expecting ‘OPEN_INVERSE_CHAIN’, ‘INVERSE’, ‘OPEN_ENDBLOCK’, got ‘EOF’

Any idea what might be wrong and how I can filter the featured posts?

You’re missing the closing {{/get}}

1 Like

By the way, if you’re developing a theme, the very best way to get a better error message and to figure out what’s wrong is to run Ghost locally (I recommend WSL if you’re on Windows) and to start ghost with ghost run -D - that gets you debugging info live. While it’s possible to deploy somewhere and then hope it works, it’s much slower and you may not have access to the error logs that way!

Oh thanks. But I’m on a full server (Cloudron). Any idea how this could be done?

I’d still recommend doing a local install - you probably don’t want to break your live website while testing, right? :)

1 Like