How can I access the products template name/type in liquid?

I want to include an if statement that says “If the product is using this template, do this” but I am not editing the product page, I am editing a section on the home page that is calling a product.

I am looking to edit the “Featured Products” section of the debut theme. The featured product settings have an option to add a product, and in that block has a setting to chose which product is displayed on the page. I am looking to add code in this section template to recognize when a product with a different page template is selected. I can get the product URL by using {{ product.url }} but I’m looking for something like {{ product.template }} but its not returning anything.

I am aware that the product page template will not affect the layout of the featured products section, I am just looking to get access to the product page template name and do the rest from there.

Hopefully this makes sense,

Thanks in advance!

  • Bailey

I actually just figured it out :confused:

I was looking in the template object, but I should have been looking in the product object. What works is {{ product.template_suffix }}

https://shopify.dev/api/liquid/objects/product#product-template_suffix