Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to make that in a text field to keep formatting? 
 
ljuter
Jr. Member
 
Total Posts:  11
Joined:  2009-01-07
Ukraine
 

How to make that in a text field (attributes field as text area) to keep formatting?
Example:
It is displayed in one line - 1 x PCIe x16 1 x PCIe x1 3 x PCI
It is necessary that it was displayed so
1 x PCIex16
1 x PCIe x1
3 x PCI

 
Magento Community Magento Community
Magento Community
Magento Community
 
fivestar
Sr. Member
 
Total Posts:  115
Joined:  2008-06-18
 

Add “<br />” w/o quotes for each new line.

ex. 1x pci <br /> 2x pci <br /> 3x asdf

 
Magento Community Magento Community
Magento Community
Magento Community
 
ljuter
Jr. Member
 
Total Posts:  11
Joined:  2009-01-07
Ukraine
 
fivestar - 18 January 2009 05:48 PM

Add “<br />” w/o quotes for each new line.

ex. 1x pci <br /> 2x pci <br /> 3x asdf

As a result on the screen it is displayed: 1 x PCIe x16 <br /> 1 x PCIe x1 <br /> 3 x PCI <br />

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageParts
Guru
 
Avatar
Total Posts:  415
Joined:  2007-11-18
 

I think Magento uses html_entity_encode on all strings. Which would mean that you have to decode your string where it’s supposed to be viewed in order for any HTML code to function properly. In the case of the <br /> tag I think you could use the example found in app/design/frontend/default/default/template/catalog/product/view/description.phtml , which is used to display the product description on product information pages. Hope it helps smile

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top