Shopify 从产品描述中删除图像

Shopify 从产品描述中删除图像,shopify,liquid,Shopify,Liquid,我只想在移动设备上显示描述中的产品图像。我不知道如何从产品描述中分割图像 <div class="product-description rte" itemprop="description"> // this works how I want it to. shows images and text <div class="mobileShow"> {{ product.description

我只想在移动设备上显示描述中的产品图像。我不知道如何从产品描述中分割图像

         <div class="product-description rte" itemprop="description">
         // this works how I want it to. shows images and text
         <div class="mobileShow"> 
          {{ product.description }} 

        </div>  

         // if not mobile device only show text. strip out images.
           {% if product.description contains "<img" %}
           // ??

          </div>

//这就是我想要的。显示图像和文本
{{product.description}}
//如果不是,移动设备只显示文本。去掉图像。

{%如果product.description包含“为什么要在描述中嵌入产品图像?你让自己的生活变得非常困难。为什么不上传产品图像,然后对你决定使用多少、哪些图像等进行逻辑区分,以及在哪里使用


操作product.images远比在描述中嵌入HTML硬编码标记容易且可靠。

为什么要在描述中嵌入产品图像?你让自己的生活变得非常困难。为什么不上传产品图像,然后对你决定使用的数量、哪些图像等进行逻辑区分在哪里

         <div class="product-description rte" itemprop="description">
         // this works how I want it to. shows images and text
         <div class="mobileShow"> 
          {{ product.description }} 

        </div>  

         // if not mobile device only show text. strip out images.
           {% if product.description contains "<img" %}
           // ??

          </div>

操作product.images比在说明中嵌入HTML硬编码标记要容易得多,也更可靠。

如果您想在移动设备上隐藏说明中的所有图像,可以使用媒体查询来定位它们

         <div class="product-description rte" itemprop="description">
         // this works how I want it to. shows images and text
         <div class="mobileShow"> 
          {{ product.description }} 

        </div>  

         // if not mobile device only show text. strip out images.
           {% if product.description contains "<img" %}
           // ??

          </div>
不过,媒体查询取决于主题。以下是一个示例:

@include media-query($small) {
  .product-description img {
    display: none;
  }
}
您希望将其添加到scss文件的末尾(很可能是
theme.scss.liquid

上面的查询用于Simple和其他一些查询-以下是列表:

  • 叙述,简单,冒险,首次亮相,无限:
    @包括媒体查询($small){
  • Jumpstart,布鲁克林,供应,Pop,最小:
    @包括在查询中($max,$small){

如果您想在手机上隐藏说明中的所有图像,可以使用媒体查询来定位它们

不过,媒体查询取决于主题。以下是一个示例:

@include media-query($small) {
  .product-description img {
    display: none;
  }
}
您希望将其添加到scss文件的末尾(很可能是
theme.scss.liquid

上面的查询用于Simple和其他一些查询-以下是列表:

  • 叙述,简单,冒险,首次亮相,无限:
    @包括媒体查询($small){
  • Jumpstart,布鲁克林,供应,Pop,最小:
    @包括在查询中($max,$small){

我正在使用Eprolo导入产品。除了每个产品的图像列表外,他们还在描述中添加图像。我可以编辑每个产品描述以在导入之前删除图像。但是,我喜欢移动设备上描述中图像的流畅性。我正在使用Eprolo导入产品。他们在广告中的描述中添加图像除了每个产品的图像列表之外。我可以编辑每个产品说明,以便在导入之前删除图像。但是,我喜欢移动设备上的图像在说明中的流畅性。