0

I am creating a CMS page in magento as a teaser for an upcoming product. I am using two columns with a right bar and using the layout update XML in the backend to call some custom blocks I make for the right side.

Well right now I am loading just placeholders then going to edit the phtmls after the fact.

If I use two blocks on the right it looks fine.. but if I add more, then the whole footer corrupts and moves to the right column.

I am trying to get 3 custom blocks on the right side.

Here is my layout update XML

<reference name="right">
<block type="newsletter/subscribe" name="left.newsletter" template="newsletter/rightsubscribe.phtml"/>
<block type="core/template" name="name1" template="page/custom/custom1.phtml"/>
<block type="core/template" name="name2" template="page/custom/custom2.phtml"/>
</reference>

Here is the HTML of the customs blocks I am using.

<div id="shop-with-confidence" class="white-box">
    <h3>Custom1</h3>
    <div class="white-box-inner">
         Testing1
    </div>


    <div id="shop-with-confidence" class="white-box">
    <h3>Custom2</h3>
    <div class="white-box-inner">
         Testing2
    </div>

Does anyone have any idea why that would be wrecking the page I am editing?

DaChavoh
  • 100
  • 1
  • 16
Dan
  • 41
  • 5
  • Since I am a newb and cant answer my own question on here yet! – Dan Jun 23 '12 at 03:51
  • Man this is bad. After about 4 hours of troubleshooting and reading way to many magento XML docs it was simply missing the closing divs on each file. I was initially thinking I couldn't use two of the same block types of the core/template variety, and obviously reading way to much into it. div oversight FTL. – Dan Jun 23 '12 at 03:51
  • Yes, this was going to be my suggestion, as it's the only possible option. – benmarks Jun 24 '12 at 11:57

1 Answers1

0

OP has already resolved the issue for himself, but it's worth noting that one can easily check parent-child block relationships to determine if an issue is framework- or markup- related.

To check the list of child blocks which a parent block has, one can simply do the following in a template:

Zend_Debug::dump($this->getChild()) //list of children
Zend_Debug::dump($this->getSortedChildren()) //list of ordered children

In the case of blocks lacking templates (core/text_list, e.g. "right"), one could do this from a child block template as well:

Zend_Debug::dump($this->getParentBlock()->getChild()) //list of children
Zend_Debug::dump($this->getParentBlock()->getSortedChildren()) //list of ordered children

Ref Mage_Core_Block_Abstract for more information.

benmarks
  • 23,384
  • 1
  • 62
  • 84