【发布时间】:2019-11-06 12:25:56
【问题描述】:
在 product-details.tpl 中,功能在分组时打印在单个
例如:
<dl>
<dt>FEATURE</dt>
<dd>Value1 Value2 Value3</dd>
</dl>
我想打印以下内容: 代码:
<dl>
<dt>FEATURE</dt>
<dd>
<span title="value1">Value1</span>
<span title="value2">Value2</span>
<span title="value2">Value3</span>
</dd>
</dl>
这是原始代码
{block name='product_features'}
{if $product.grouped_features}
<section>
<h3>{l s='Data sheet' d='Shop.Theme.Catalog'}</h3>
<dl>
{foreach from=$product.grouped_features item=feature}
<dt>{$feature.name}</dt>
<dd>{$feature.value|escape:'htmlall'|nl2br nofilter}</dd>
{/foreach}
</dl>
</section>
{/if}
{/block}
我试过了
{if $product.grouped_features}
<section>
<h3>{l s='Data sheet' d='Shop.Theme.Catalog'}</h3>
<dl>
{foreach from=$product.grouped_features item=feature}
<dt>{$feature.name}</dt>
<dd>{foreach $feature.value}<span title="{$feature.value|replace:' ':'_'}">{$feature.value|escape:'htmlall'|nl2br nofilter}</span>{/foreach}</dd>
{/foreach}
</dl>
</section>
{/if}
但是当然不行..
非常感谢任何可能的帮助。 谢谢
【问题讨论】:
标签: prestashop smarty prestashop-1.7