Magento编辑器在添加新产品时自动换行符问题
我正在Magento CE 1.7.0.2中添加一个新产品。我在属性中输入了HTML代码。Magento编辑器在添加新产品时自动换行符问题
我的问题:我真的不知道这些额外的<br>
从哪里来。即使所见即所得编辑器没有显示这些<br>
,但它们出现在网站的产品页面上。请帮忙。
什么我进入:
<p>Product Description:</p>
<table border="1" cellspacing="0" cellpadding="5px">
<tr>
<td>Category</td>
<td>Specials</td>
</tr>
<tr>
<td>Texure</td>
<td>Digitally Printed on High Quality Matte Paper</td>
</tr>
</table>
它显示的是:
<p>Product Description:</p>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<table border="1" cellspacing="0" cellpadding="5px">
<tr>
<td>Category</td>
<td>Specials</td>
</tr>
<tr>
<td>Texure</td>
<td>Digitally Printed on High Quality Matte Paper</td>
</tr>
</table>
这些额外的休息是由应删除的nl2br()
函数引起的。
要解决此为简短说明,打开应用程序/设计/前端/ [包装]/[主题] /template/catalog/product/view.phtml,发现:
<?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?>
和
<?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
要解决此为描述,打开应用程序/设计/前端/ [PAC:通过更换这卡格]/[主题] /template/catalog/product/view/description.phtml,发现:
<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), nl2br($_description), 'description') ?>
和relace此:
<?php echo $this->helper('catalog/output')->productAttribute($_product, $_product->getDescription(), 'description') ?>
有你看到了css规则? –
当你在编辑器中输入它时,试着去编码视图,看看会发生什么 –
@NewBee CSS不能添加'
'元素。所见即所得的编辑器和代码视图,都没有任何
元素。 –