【问题标题】:How to set the default store image in Demandware如何在 Demandware 中设置默认商店图片
【发布时间】:2016-08-10 04:57:20
【问题描述】:

在 Demandware 中,将商店添加到系统后,默认商店图像会损坏。我听说有一种方法可以上传默认图像,以便将其用作默认值。

有人可以指点我有关该主题的文档的方向,或者让我知道如何做到这一点。

在此先感谢 Tristam。

【问题讨论】:

  • the default store image 到底是什么意思?你指的是哪个资源?

标签: demandware


【解决方案1】:

我相信这与实际的 Store 对象无关,而是与产品图片有关。由于 Demandware 中没有“默认商店图像”,因此这是最合理的推断恕我直言。

因此,如果您需要显示上面的默认图像,则需要在模板中使用 if 条件:

<isset name="Product" value="${pdict.Product}" scope="page" />

<!-- stuff -->

<isif condition="${!empty(Product.getImage('hi-res', 0))}">
    <isset name="imageURL" value="${Product.getImage('hi-res', 0).getURL()}" scope="page" />
<iselse/>
    <isset name="imageURL" value="${dw.web.URLUtils.staticURL('/images/noimagelarge.png')}" scope="page" />
</isif>

<!-- stuff -->

<img src="${imageURL.toString()}" alt="Product image or default image" />

您也可以查看/app_storefront_core/cartridge/templates/default/product/components/productimages.isml 文件的用法。不要忘记根据您的设置调整您的尺寸(hi-resnoimagelarge)。

【讨论】:

    【解决方案2】:

    如果商店的图片在前端损坏,很可能您确实设置了图片属性,但图片没有上传(到正确的位置),因此您最终得到了无法解析的引用。

    【讨论】:

      猜你喜欢
      • 2021-05-31
      • 2018-11-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-05
      • 1970-01-01
      相关资源
      最近更新 更多