Have you ever been working on the frontend of a Magento site and realized you needed a specific page to look different? Have you ever thought you were finished skinning your whole site only to later discover that you missed some pages? If your answer to either of these questions is ‘yes’, and if you have been working with Magento for a while, you most likely are aware that Magento has many pages and different body classes for them. This is a very useful feature, as it helps make page customization easy with CSS.
But, remembering all of these pages and body classes isn’t easy and Magento does not provide you with a list. This is why I’ve put one together, and decided to share a list of Magento Pages and Body Classes with everyone to potentially ease some aggravation while testing your site’s frontend.
The format here will be:
The bolded letters in the body class or URL path indicate text specific to the site you’re on. And anything inside parenthesis indicates a part of the URL path that can be removed in the admin panel Catalog SEO options
So here we go:
.catalog-category-view .categorypath-category-path-name .category-category-name
/category-name/sub-category-name/product-name(.html) or /product-name(.html) (depending on how you set it up in the admin panel)
.checkout-cart-configure .catalog-product-view .product-product-name
.wishlist-index-configure .catalog-product-view .product-product-name
/customer/address/index or /customer/address
Use search bar
/rss (you need to turn this on in the admin panel)
That is a lot of pages, isn’t it? Magento does a fairly good job assigning all these intuitively named body classes to its pages. Although, sometimes you need some extra ones. I will show you a few different ways to add extra body classes to your pages in my next blog post. Stay tuned 🙂 and let me know in the comments if you have any questions or if you know of some pages I may have missed.