Fix Bullet Points and Ordered Lists In Magento

Here is one problem that was a simple Magento fix, but took me hours to understand. Of course many of my products require bullet points – it’s like a standard on eCommerce products. When I imported or even manually inserted them into my Magento website it would never display correctly. I searched the forums, google, and even asked a few people. There was no easy answer. I gave up and came back the next day. I luckily stumbled on this quick and simple fix in the Magento wiki:

Add this code to the bottom of your boxes.css: (/skin/frontend/default/-YOURTHEME)/css)

1
2
3
4
5
6
.product-specs ul li { list-style-type: disc; list-style-position: outside; margin-left: 20px; }
.short-description ul li { list-style-type: disc; list-style-position: outside; margin-left: 20px; }
.product-specs ol li { list-style-type: decimal; list-style-position: outside; margin-left: 20px; }
.short-description ol li { list-style-type: decimal; list-style-position: outside; margin-left: 20px; }<a href="http://www.robbiehodge.com/wp-content/uploads/2010/04/bullets.jpg"><img src="http://www.robbiehodge.com/wp-content/uploads/2010/04/bullets.jpg" alt="" title="bullets" width="127" height="71" class="alignright size-full wp-image-156" /></a>
.description ul li { list-style-type: disc; list-style-position: outside; margin-left: 20px;}
.description ol li { list-style-type: decimal; list-style-position: outside; margin-left: 20px;}

Now open up view.phtml (app/design/frontend/default/-YOURTHEME-/template/catalog/product/view.phtml)

Find this code:

1
<div class="short-description"><?php echo nl2br($_product->getShortDescription()) ?></div>

Replace with:

1
<div class="short-description"><?php echo $_product->getShortDescription() ?></div>

Do the same for description field and now you have bullets and ordered lists..

Hopefully one day this will be fixed/patched in. I really enjoy the wysiwyg editor, but sometimes it just causes more problems then its worth.

Follow Robbie Hodge:

2 Responses to “Fix Bullet Points and Ordered Lists In Magento”

  1. GoodBoat says:

    Is this a bit out of date now? I had a look in ‘/skin/frontend/default/-YOURTHEME)/css’ but there’s no file called boxes.css. I’ll have a dig around and see if they’ve moved it. Thanks anyway…

  2. Robbie Hodge says:

    I would say it is. Lots of small things changed in the 1.4 update.

    Are bullets still broken in 1.4? Let me know and I’ll edit the post/email you the correct code.

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.