【发布时间】:2019-04-10 11:09:40
【问题描述】:
我有一个带有元字段的 Shopify 产品。 元字段将有关产品的额外信息返回到产品页面。 特别是,它以选项卡格式返回目录(产品功能) - 请参见下面的示例图片。
我希望元字段也返回特定的产品图像并将其格式化在表格中。
我想这样做的原因是我想在产品图像上使用图像映射 (https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_areamap),以便当用户单击图像上的产品功能时,表格行与相关信息将突出显示。
下面是我的意思的一个例子。
DETAILS 选项卡是从这个包含 2 列的元字段中获取其信息的 - 按照下面的代码。
左列 (1) 应返回特定产品图片,右列 (2) 是包含相关信息的表格 - 因此,当用户单击图像标注 (3) 时,相关表格行会突出显示 (3 )。
我的代码在元字段中如下所示。 但它只是呈现液体代码 - 而不是图像。 元字段可以处理液体代码还是 Shopify 可以在从元字段传递液体代码后对其进行处理? 或者最好的方法是什么?
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-6"><!-- Image column START -->
{% for image in product.images offset:9 limit:1 %}<!-- Show specific image START -->
<img src="{{ image.src | product_img_url: 'master' }}">
{% endfor %}<!-- Show specific image END -->
</div><!-- Image column END -->
<div class="col-sm-12 col-md-12 col-lg-6"><!-- Details column START -->
<table id="product-table">
<tr>
<td>Rear view mirror</td>
</tr>
<tr>
<td>ABS Brakes</td>
</tr>
<tr>
<td>6 Speed Transmission</td>
</tr>
<tr>
<td>Lowerd Seat Height</td>
</tr>
</table>
</div><!-- Details column START -->
</div>
【问题讨论】: