在我的模板主题中,我包含了几个不同大小的产品图表,我打算通过更改大小图表文档的路径来包含这些图表。我在模具文档中找到了dynamicComponent,我认为我理解了它的工作方式。在我的更高级别的partial中,我以这种方式将字符串绑定到组件- (product.html)
<div class="container" itemscope itemtype="http://schema.org/Product">
{{> components/products/product-view schema=true sizeChart='components/products/size_charts/tshirt.html'}}
{{#if product.videos.list.length}}
{{> components/products/videos product.videos}}
{{/if}}
{{#if settings.show_product_reviews}}
{{> components/products/reviews reviews=product.reviews product=product urls=urls}}
{{/if}}
</div>(product-view.html)
{{#if sizeChart}}
<div class="tab-content" id="tab-sizeChart">
{{dynamicComponent sizeChart}}
</div>
{{/if}}我希望在将来的主题维护中更改的是变量sizeChart。当页面呈现时,我编写dynamicComponent的地方是空白的。
发布于 2017-08-03 01:49:46
我使用了if条件句而不是dynamicComponent。不是我想的那样。
https://stackoverflow.com/questions/42766957
复制相似问题