Customize the Content Layout on Magento Category Pages

Add content above and below Magento product listings using the Category Description available in 1.4, then updating where the static block displays on the category page when customizing the Display Settings to include both a static block and products.

The main focus of being able to customize the content in Magento category pages was to add the ability for me to be able to have an introductory paragraph of content, but also add additional content after the product listing. Thus I was able to add a foundation of custom content to main category pages without pushing the products further and further down the page. [Read more…]

Removing Extra Line Breaks Added To Magento Product Descriptions

In order to remove the extra line breaks that are added to Magento product descriptions. Simply update the following file:

/app/design/frontend/base/default/template/catalog/product/view/description.phtml

Edit the line nl2br($_description) to $_description, removing nl2br.

The added line breaks were causing issues in Firefox when creating unordered lists and such as the list code would have an added line break, <br>, or what appeared to be line spacing added to each item within the list.

Add Custom Content to Magento Category Pages

For an updated variation on how to accomplish custom content on Magento Category pages, view this post > Customize the Content Layout on Magento Category Pages

When adding custom content to the category pages on your site, I find the category description to be very limiting and not necessarily give me the type of control I want to have over how much content I can add to a page without pushing the products below the fold. This tutorial outlines how you can use Custom CMS Blocks to design the exact layout you desire for your category pages.

First you will want to create a static block that will end up replacing the category page setup.

CMS > Static Block

Once created you may need to grab some of the template code in order to setup the static block so the text areas match the design of the template.

Personally I create an introductory paragraph followed by the product listings, then adding another section of content below the products that is more expansive and creates more unique content for my main category pages.  Simply update the cat_ID with the corresponding category products you want to display on this page, set the status to ‘Enabled’ and save the CMS Custom Block.

Content

{{block type=”catalog/product_list” column_count=”3″ category_id=”cat_ID” template=”catalog/product/list.phtml”}}

Content

Now you can setup the category page to display the custom block you have created, rather then just using the category description as it limits your control over where you can implement content.

Catalog > Manage Categories

Select the category and click on the Display Settings tab. Under Display Mode select Static Block only as we have used custom code to display the products between our content blocks. Now you simply have to select the CMS Block you created and save the changes.