This was uploaded via Labs and in desperation, I also restarted ghost several times.
However, the filters do not seem to have any effect at all. On both / and zh/ I see all the posts (i.e. those without tags plus those tagged with “#zh”).
Yes I’ve uploaded an index-zh.hbs file. It seems to be picked up correctly because I included the conditional HTML language template (as per the tutorial):
{{!< default}}
{{!-- The tag above means - insert everything in this file into the {body} of the default.hbs template --}}
{{#contentFor "lang"}}zh{{/contentFor}}
and the blog posts correctly contain the <html lang="zh"> tag.
Simply a lack of bandwidth… We had done quite a lot of customisations on our current theme (based on Ghost v2) and so wanted to defer an upgrade to Ghost v3 as we weren’t sure whether there would be any incompatibilities between the theme and Ghost v3.
If there’s no ready/obvious fix to this issue then yes we’ll bump up the priority of the update to Ghost v3 to see if that fixes it.
We had done quite a lot of customisations on our current theme (based on Ghost v2) and so wanted to defer an upgrade to Ghost v3 as we weren’t sure whether there would be any incompatibilities between the theme and Ghost v3.
When it comes to major software versions, holding off upgrading because you’re worried about incompatibility is misconceived! The longer you hold off, the bigger the gap becomes between the software you are using and the latest version and the more changes (and potential incompatibilities) you’re dealing with.
Actually, the best time to upgrade is once the first minor goes out. E.g. once 3.1.0 is shipped.
Upgrading direct to a major like 3.0.0 means you’ll get caught out in any initial bugs, so holding off one minor gives you a little more confidence that any major unexpected compatibility issues have been solved.
Not only that, but this is the time when the core team and the community are most context loaded about compatibility and therefore most able to quickly help. 10 months on, noone remembers what v2 was like!
This doesn’t just apply to Ghost nor is it specific to you - just a passing thought I wanted to share.
Thanks for the feedback on upgrade policy @Hannah, definitely worth bearing in mind for the future.
After my slight detour to upgrade-land , the blog is now upgraded to v3.22.1.
Sadly, doesn’t seem to have helped with the filtering.
It’s almost as if it’s ignoring the filter conditions as whatever I put in there doesn’t seem to have any effect. E.g. if I change the filter for the default collection to show some arbitrary (and non-existent) tag like filter: 'tag:faketag' then I’d expect to see no blog posts in that collection. But even with such a filter I still get all the posts appearing on the homepage.
Is there a way to debug the routes/filters to see what values are actually being used?
{{!< default}}
{{!-- The tag above means - insert everything in this file into the {body} of the default.hbs template --}}
{{#contentFor "lang"}}{{@site.lang}}{{/contentFor}}
{{!-- The tag below includes the theme header - partials/header.hbs --}}
{{> header}}
{{!-- The content area on the blog page --}}
<div id="content" class="site-content">
<main id="main" class="site-main outer">
{{!-- The tag below includes the post loop - partials/loop.hbs --}}
{{> "loop"}}
</main><!-- .site-main -->
</div><!-- .site-content -->
And index-zh.hbs:
{{!< default}}
{{!-- The tag above means - insert everything in this file into the {body} of the default.hbs template --}}
{{#contentFor "lang"}}zh{{/contentFor}}
{{!-- The tag below includes the theme header - partials/header.hbs --}}
{{> header}}
{{!-- The content area on the blog page --}}
<div id="content" class="site-content">
<main id="main" class="site-main outer">
{{!-- The tag below includes the post loop - partials/loop.hbs --}}
{{> "loop"}}
</main><!-- .site-main -->
</div><!-- .site-content -->
To isolate this, I tried temporarily changing the theme to Casper and interestingly enough filtering started working.
So potentially there’s something in the theme, or how Ghost interacts with it, that is causing filtering to fail. Although I don’t know enough to debug it further.
Right so there you go… your templates aren’t using dynamic routing. They’re doing their own local get request to fetch tags with the filter featured:false.