在某些情况下,您可能需要为同一模板创建不同的标记。例如,您可能想要创建一个替代模板,其中包含特定产品的不同部分。
template-name是模板名称,template-suffix是备用名称,template-file-type是文件类型,即json或liquid:template-name.template-suffix.template-file-typeproduct.alternate.jsonviewURL参数在前端页面查看viewURL参数在页面上呈现备用模板。此参数应为?view=[template-suffix],其中[template-suffix]是模板的备用名称。product.alternate.json模板和一个名为示例产品的产品,您可以使用以下方式使用该模板渲染该产品:/products/example-product?view=alternate