FROM CACHE - zh-cn_header

How do I find the name of the template?

glass1case
观光客
4 0 1

Since shopify backend doesn't support setting search engine optimization keywords for pages, I want to add keywords for pages through code.
Now I have a problem, I don't know the name of the template that corresponds to the product page, about us page. It's where the red line is in the image.
So far I have made sure that the index and blog are correct. So, how should I know the template name for other pages (e.g. product listing page, FAQ page, contact us page)?
Looking forward to the expert's answer, thanks.

1.png

6 条回复6

豪克斯
Shopify Partner
42 4 6

你可以试试template.name

v:Simon_Du_
有问题随时call
glass1case
观光客
4 0 1

Can you tell us how that works exactly?

豪克斯
Shopify Partner
42 4 6

中文交流嘛,template就是一个对象,取它里面的name这个key就可以拿到每个模板的名字

v:Simon_Du_
有问题随时call
glass1case
观光客
4 0 1

哈哈好滴,我还以为是自动翻译成中文了。你说的很对,关键是怎么取name的这个值?直接在代码里面输出template.name,然后在源代码里面去看输出结果吗? 可否麻烦写个代码看下?

glass1case
观光客
4 0 1

非常感谢老哥,我已经解决了了。顺便问一下,你会调整模版的幻灯片的代码吗?1.png

豪克斯
Shopify Partner
42 4 6

具体怎么修改

v:Simon_Du_
有问题随时call