【问题标题】:CS-Cart/Smarty How to strip Image Tags from Product Thumbnails?CS-Cart/Smarty 如何从产品缩略图中去除图像标签?
【发布时间】:2016-07-08 13:09:30
【问题描述】:

我正在尝试从 CS Cart List Thumb 中删除图像标签,

{include file="common/image.tpl" image_width="400px" image_height="400px" images=$product.main_pair obj_id=$obj_id_prefix no_ids=true class="ty-thumbnail-list__img|strip_tags"}

有谁知道为什么 strip_tags 不起作用?

【问题讨论】:

    标签: smarty cs-cart


    【解决方案1】:

    不太确定你想做什么,但无论如何,你把strip_tags放在了错误的地方

    strip_tags 是变量或字符串的修饰符,它的工作原理如下:

    {$variable|strip_tags}
    {'My <b>text</b>'|strip_tags}
    

    您只是将它作为类的名称传递。请阅读更多关于 strip_tags 的工作原理here

    【讨论】:

    • 我使用了相同的方法,但是我发现有时我想删除图像,但又想使用其他文本样式选项。是否有更精确的修饰符来仅删除图像但保留文本样式
    猜你喜欢
    • 2020-04-18
    • 1970-01-01
    • 1970-01-01
    • 2014-04-06
    • 2021-11-10
    • 2011-10-16
    • 2017-01-15
    • 2019-04-18
    • 2019-02-09
    相关资源
    最近更新 更多