Create a if statement based on article template

123julien
Tourist
8 0 2

Hi guys, 

I have set up 3 different article templates for my blog (article.video.liquid / article.podcast.liquid + the article.liquid). 

On my customer/account page I have a list of articles for the customer and I would like to create a if statement based on the article template to display different icons based on the template used for the article. 

Is there any liquid object I can use to pull this info ? I have tried things like {{ article.template }} but nothing works.

Thanks a lot for your help ! 

Julien

0 Likes
gina-gregory
Shopify Expert
710 48 175

Try this:

{% if template == 'article.video' %}
  ...
{% elsif template == 'article.podcast' %}
  ...
{% endif %}
0 Likes
123julien
Tourist
8 0 2

Thanks for helping out ! 

Sadly it doesn't work. I also tried just displaying {{ template }} and it returns the page template (here : customer/account)...so I don't think template can be used here sadly.

0 Likes