Any way to use Handlebar to check URL

Hello all,

long time no speak! I am developing my own Ghost them currently and wish to use a different pagination style on home page url.com than on blog page url.com/blog/slug

I has hoping I could do this with different partials but I presume the pagination partial {{pagination}} gets more information then regular {{. partial}}

I have tried to use the following to filter this:

{{#has slug="blog"}}
<nav class="pagination" role="navigation">
    {{#if prev}}
        <a class="newer-posts" href="{{page_url prev}}">&larr; Newer Posts</a>
    {{/if}}
    <span class="page-number">Page {{page}} of {{pages}}</span>
    {{#if next}}
        <a class="older-posts" href="{{page_url next}}">Older Posts &rarr;</a>
    {{/if}}
</nav>

{{else}}
<nav class="pagination">
    {{#if next}}
        <a class="older-posts" href="{{page_url next}}"></a>
    {{/if}}
</nav>
{{#if next}}
    <div class="infinite-scroll-status">
        <div class="infinite-scroll-request"></div>
    </div>
{{/if}}
{{/has}}

But this does not work. Any help or other ideas I would be very grateful.

and in true sods law I solved this minutes after posting by using

{{#is "home"}}

Glad you got it fixed! Docs here for anyone who find this thread later :)

1 Like