【问题标题】:categories image was not showing in prestashop类别图像未在 prestashop 中显示
【发布时间】:2012-01-02 13:31:40
【问题描述】:

您好,我使用此代码显示具有相应图像的类别。我正在使用 prestashop 1.4.4

<ul>            
{foreach from=$blockCategTree.children item=child name=blockCategTree}
{if $smarty.foreach.blockCategTree.last}
{include file="$branche_tpl_path" node=$child last='true'}
{else}
{include file="$branche_tpl_path" node=$child}
{/if}
<img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" />          
{/foreach}      
</ul>   

通过使用 firebug 查看 src 属性,它显示的路径如下 - /prestashop/img/c/-category.jpg

我希望像这样显示图像-“/prestashop/img/c/6-category.jpg” 这里 6 是图像 ID。我如何使用代码来获取上面的 url。

【问题讨论】:

    标签: php prestashop


    【解决方案1】:

    我想这就是你需要的

    <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_category,'category_default')|escape:'htmlall':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
    

    【讨论】:

      【解决方案2】:

      嗨,也许这可以帮助你

      <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}" class="img">
      

      【讨论】:

        猜你喜欢
        • 2012-01-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多