Recherches récentes
Pas de recherche récente
Handlebars language to not to display certain articles with a specific character in the title
Publication le 18 oct. 2023
For my helpcenter, i search the way not to display the articles with a certain character. So i found the filter helper with the attributes "starts_with" or "contains", but i need the opposite: "does not begin with" or "does not contain" but I can't find how to do it
https://developer.zendesk.com/api-reference/help_center/help-center-templates/helpers/#filter-helper
And the problem is that the precise requirement is as follows: on the home page, we display the list of the first 3 articles in a section, and we don't want to display certain articles.
So when I try to use "#contains"/else after the {{#each articles}} (because otherwise it doesn't work), it only works partially, because it doesn't display the unwanted articles but they are taken into account when counting the 3 articles to display = I sometimes end up with 0 articles displayed.
That's why I wanted to use the filter directly on the {{#each articles}} but I need to oppose it with {{!--#each (filter articles on="title" starts_with=">")--}}
So it would be a good development to be able to query a "does not begin with" or "does not contain" in the "filter". And outside it too.
In the meantime, if anyone has a solution, I'd love to hear from you.
0
1 commentaire
Anne-Flore Caire
Except that not all filters work depending on where you are in the code. And I'm not getting the expected result
0