I want to do a few things, and I am new and very very far from proficient with Magento; what I am asking for is the best, most concise way to do the following:
I would like to edit the content of my home page—and probably every other CMS page, as I get further in this project—in my text editor and not in the admin panel WYSIWYG. I guess I'd just have a template like
home-content.phtml
containing my markup for my carousel(s) and whatever else I end up putting on my home page. It seemed to me the most logical way to do this is attach myhome-content.phtml
to thegetChildHtml('content')
method in Admin panel -> CMS -> Pages -> Home Page -> 'Design' tab -> Layout Update xml with code like this:<reference name="content"> <block type="core/template" name="home-content" as="home-content" template="home-content.phtml" /> </reference>
However, that was messed up by the next thing I wanted to do...
In my opinion, the default Magento HTML structure is horrifically bloated, with too many nested
div
's (wrapper -> page -> main-container col1-layout -> main -> col-main just to get to the content of a page). It makes styling with Sass a nightmare for me, with all those classes' styles split up into 5 different Sass partials. So, I am cleaning up the default structure to match my own design principals. Part of this means removing empty elements, such as the infamous<div class="std"> </div>
. The most efficacious way to get rid of this (as I don't plan on using the admin panel for content) is with<remove name="cms.wrapper">
in the CMS Home Layout Update XML. The problem is, this removes anything I add with the method above (reference name="content"
).
Basically: How can I add content to my Home Page with a .phtml
and remove the <div class="std"> </div>
without a conflict? I don't understand how the functionality of admin -> CMS -> layout update XML differs from the functionality of layout.xml, or why I should use one over the other (like, could I not use <cms index-index>
to do the same thing?).
Thanks in advance, everyone.
.std
adds list styles where they aren't wanted. Predictably with Magento, it's a lengthy procedure to resolve.