Magento 在masnory jquery中插入一项
在magento的一个产品列表页面中,我使用了砖石结构,效果很好。但是现在我想添加一个div,在砖石区域中有一些文本。我试过这个,我得到了结果,但它打破了砖石项目。我用过的代码Magento 在masnory jquery中插入一项,magento,jquery-masonry,Magento,Jquery Masonry,在magento的一个产品列表页面中,我使用了砖石结构,效果很好。但是现在我想添加一个div,在砖石区域中有一些文本。我试过这个,我得到了结果,但它打破了砖石项目。我用过的代码 <?php if ($category_nameplace == round($_collectionSize/2)): ?> <div class="item"> <h2 class="productcategory-name"><?php echo $
<?php if ($category_nameplace == round($_collectionSize/2)): ?>
<div class="item">
<h2 class="productcategory-name"><?php echo $this->getLayer()->getCurrentCategory()->getName() ?></h2>
</div>
<?php endif; ?>
上述代码用于将额外项目插入砌体区域。在上面的代码中,我计算项目编号,当我得到中间编号时,我将div插入到下面的书写区域
<div id="basic" class="products-grid unstyled thubmnails js-masonry">
<?php $category_nameplace = 0; foreach ($_productCollection as $_product): ?>
<?php $category_nameplace++; ?>
<div class="item">
<div class="thumbnail">
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image thumbnail"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(rand(135,400)); ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
<div class="caption">
<h2 class="product-name product-info"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h2>
<h2 class="product-info"><?php echo "Dimension:".$_product->getDimension(); ?></h2>
<h2 class="product-info"><?php echo $_product->getPrice(); ?></h2>
</div>
</div>
</div>
<?php endforeach ?>
</div>
您找到解决方案了吗?请分享解决方案