2013-02-05 26 views
3

我正在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> 
+0

有你看到了css規則? –

+0

當你在編輯器中輸入它時,試着去編碼視圖,看看會發生什麼 –

+0

@NewBee CSS不能添加'
'元素。所見即所得的編輯器和代碼視圖,都沒有任何
元素。 –

回答

10

我已經找到了答案上this link

+0

如果這是好的,請接受你自己的答案;) – dagfr

1

這些額外的休息是由應刪除的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') ?>

Source