Prestashop &引用;联合国集团“;产品特点

Prestashop &引用;联合国集团“;产品特点,prestashop,smarty,prestashop-1.7,Prestashop,Smarty,Prestashop 1.7,在product-details.tpl中,分组后的功能将打印在单个 例如: <dl> <dt>FEATURE</dt> <dd>Value1 Value2 Value3</dd> </dl> 特色 值1值2值3 我想打印以下内容: 代码: 特色 价值1 价值2 价值3 这是原始代码 {block name='product_features'} {if $product.grouped_f

在product-details.tpl中,分组后的功能将打印在单个

例如:

<dl>
   <dt>FEATURE</dt>
   <dd>Value1 Value2 Value3</dd>
</dl>

特色
值1值2值3
我想打印以下内容: 代码:


特色
价值1
价值2
价值3
这是原始代码

  {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}
{block name='product\u features'}
{if$product.grouped_features}
{l s='数据表'd='Shop.Theme.Catalog'}
{foreach from=$product.grouped_features item=feature}
{$feature.name}
{$feature.value | escape:'htmlall'| nl2br nofilter}
{/foreach}
{/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}
{if$product.grouped_features}
{l s='数据表'd='Shop.Theme.Catalog'}
{foreach from=$product.grouped_features item=feature}
{$feature.name}
{foreach$feature.value}{$feature.value |转义:'htmlall'| nl2br nofilter}{/foreach}
{/foreach}
{/if}
但是当然不行

非常感谢任何可能的帮助。 谢谢你

试试:

{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>
                    {assign var=detail_feature value="<br />"|explode:$feature.value} 
                    <dd>
                        {foreach from=$detail_feature item=det_feature}
                            <span title="{$det_feature|escape:'htmlall'|nl2br nofilter}">{$det_feature|escape:'htmlall'|nl2br nofilter}</span>
                        {/foreach}
                    </dd>
                {/foreach}
            </dl>
        </section>
    {/if}
{/block}
{block name='product\u features'}
{if$product.grouped_features}
{l s='数据表'd='Shop.Theme.Catalog'}
{foreach from=$product.grouped_features item=feature}
{$feature.name}
{assign var=detail_feature value=“
”分解:$feature.value} {foreach from=$detail\u feature item=det\u feature} {$det_功能|转义:'htmlall'| nl2br nofilter} {/foreach} {/foreach} {/if} {/block}
谢谢您的回答。几乎可以,但当值超过1个单词时,它也会将它们分开。。例如,值为:值1它打印值1确定那么您的分隔符是什么?值由一个
分隔,它现在打印值1
值2
{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>
                    {assign var=detail_feature value="<br />"|explode:$feature.value} 
                    <dd>
                        {foreach from=$detail_feature item=det_feature}
                            <span title="{$det_feature|escape:'htmlall'|nl2br nofilter}">{$det_feature|escape:'htmlall'|nl2br nofilter}</span>
                        {/foreach}
                    </dd>
                {/foreach}
            </dl>
        </section>
    {/if}
{/block}