调用成功页面上的自定义块Magento


Call custom block on Success Page Magento

我需要调用成功页面上的自定义块

我已经尝试了下面提到的布局

   <checkout_onepage_success translate="label">
        <reference name="content">
            <block type="checkout/onepage_success" name="checkout.success" template="checkout/success.phtml" >
                <block type="core/template" name="birthday" template="checkout/message/birthday.phtml"/>
            </block>
        </reference>
    </checkout_onepage_success>

在成功页面

echo $this->getChildHtml('birthday');

我在页面上收到了两次生日块。

请告诉我如何在成功页面上调用自定义块。

我不想使用动态块,即

echo $this->getLayout()->createBlock('core/template')
->setTemplate('checkout/message/birthday.phtml')->toHtml(); 

由于success.phtml:中的这一行,您将两次获得birthday

 <?php echo $this->getChildHtml() ?>

这条线渲染主块的所有子块
如果您希望它只列出一次,请删除行

echo $this->getChildHtml('birthday');

无论如何,它都会被getChildHtml方法重新定义。