这是我在 prestashop 中使用的模块的 smarty 模板。它使用 <ul>
对于每个类别.. 并且该类别的每个元素都在 <li>
中.
{assign var=zItem value=0}
{if isset($isian) AND $isian}
{foreach from=$isian item=cat name=productCat}
{assign var=zItem value=$zItem+1}
{$products=$cat.produk}
{if isset($products) && $products}
{counter name=active_ul assign=active_ul}
{include file="$style" class='homefeatured tab-pane' id='prodcat' active=$active_ul}
{/if}
{/foreach}
{else}
<p>{l s='No featured products' mod='prodcat'}</p>
{/if}
Items 已经正确显示,它是 inline-block float left。我希望图片中的第三项紧挨着第二项,但它们不是,因为它们属于不同的 <ul>
秒
我如何编辑 smarty 模板,以便它只将所有元素放在一个中 <ul>
不管他们属于什么类别?
或者不用<ul> and <li>
完全.. 只是 div.. 只要第三项动态地紧挨着第二项。
如果有帮助,下面是 tab.tpl 文件 =/
{*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2014 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}am using in prestashop. It uses a <ul> for every category.. and each item for that category is in a <li>.
{assign var=z
<li><a class="homefeatured">{l s='By Category' mod='prodcat'}</a></li>
最佳答案
我刚刚添加了这个脚本。
var cnt = $(".homefeatured").contents();
$(".homefeatured").replaceWith(cnt);
$('.last-in-line, .last-item-of-tablet-line ,.first-item-of-mobile-line').removeClass('.last-in-line, .last-item-of-tablet-line ,.first-item-of-mobile-line');
$('.last-in-line, .last-item-of-tablet-line ,.first-item-of-mobile-line').removeClass('last-in-line last-item-of-tablet-line first-item-of-mobile-line');
$('.last-mobile-line').removeClass('last-mobile-line');
$('.last-item-of-mobile-line').removeClass('last-item-of-mobile-line');
$('.first-in-line , .first-item-of-tablet-line').removeClass('first-in-line first-item-of-tablet-line');
$('.last-line').removeClass('last-line');
$('.ajax_block_product').wrapAll('<ul id="prodcat" class="product_list grid row homefeatured tab-pane" />');
关于javascript - 我如何修改这个 smarty 模板,以便它只对所有类别使用一个 <ul>?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33164756/