How to remove <br /> added by magento.
Posted Tue, 02/16/2010 - 10:10am
In case you're wondering why your product description is all spaced out, then that's because magento is adding automatic line breaks into the content description area...
To get rid of it... look for
nl2brspecifically in description.phtml you'll see
<div class="std">
<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), nl2br($this->getProduct()->getDescription()), 'description') ?>
</div>it should look like this after you take the nl2br out:
<div class="std">
<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), ($this->getProduct()->getDescription()), 'description') ?>
</div>
Comments
Thanks for the tip...
by Anonymous - 02/16/2010 - 10:16am
Thanks for the tip...
very useful!
by Owen - 04/06/2010 - 4:37pm
thanks for this useful post! i fix the problem,it looks pretty good now!
thanks again!
It simply doesn't work! I
by David - 04/19/2010 - 11:18am
It simply doesn't work! I tried to remove that part of the code and it is still the same. Still having 's in every description!
Problem Fixed! (Note: DIDN'T
by David - 04/19/2010 - 11:53am
Problem Fixed! (Note: DIDN'T CHANGED ANYTHING IN THE .PHP FILE or ANYWHERE ELSE AS BEING SUGGESTED IN MANY PLACES)
Went to in Admin
In Catalog>Attributes>Manage Attributes look for "Description" and "Short Description" attributes. Once in look for "Enable WYSIWYG" option and select "Yes".
That's it!
(The above suggestions with the code editing, etc. may work if you do not have any attributes installed. If you do, don't bother.)
If that removes the generated
by duntuk - 04/20/2010 - 6:16pm
If that removes the auto-generated line breaks in code while inputing custom/advanced HTML, then that would work.
However, with your suggestion, enabling the WYSIWYG editor, logic would state that would only make things worse--i.e. one would turn off the the WYSIWYG editor to do hand coded (custom) HTML, not turn it on. WYSIWYG does exactly what this suggestion is trying to prevent, it automatically ads HTML line breaks/paragraphs during carriage returns.
btw, you have to make sure
by duntuk - 04/20/2010 - 8:00pm
btw, you have to make sure you're editing the currently used theme.
Thanks, works perfectly!
by Elijah - 06/09/2010 - 3:08am
Thanks, works perfectly!
Post new comment