cactusphone
cactusphone

Reputation: 537

Bigcommerce Handlebars if one of / if x or y

Is there a way with the helpers provided to check if object is one of several strings, like the following:

{{#or (page_type '===' 'blog') (page_type '===' 'blog_post')}}

Happy to use some other transformation to get at the same result, but I haven't found a way. Frustrating to have to repeat code blocks to achieve this result.

Upvotes: 1

Views: 529

Answers (1)

Zhejian Zhao
Zhejian Zhao

Reputation: 11

Not sure if this is a late answer but you can use this:

{{#or (if page_type '===' 'blog') (if page_type '===' 'blog_post')}}

Upvotes: 1

Related Questions