Magento – Show block and template from other extension

blockslayouttemplate

I'm having some troubles in showing one simple block from other model.

I have these extensions:

Extension 1: /app/design/frontend/base/default/template/[module]_1/

Extension 2: /app/design/frontend/base/default/template/[module]_2/

I want to show one block from [module]_1 in [module]_2.

I already put some code in [module]_2 .xml file:

<block type="[module]_1/onepage_pickmeshops_dropdown" name="[module]_1.pickmeshops.dropdown" as="pickme" template="[module]_1/checkout/onepage/shipping_method/pickmeshopsdropdown.phtml"/>

And added this code where i want to display the info:

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

But after all i can't see what i want to see..


Update:

Here is my module 2 .xml:

<block type="checkout/onepage_review" name="checkout.onepage.review" as="review" template="onepagecheckout/onepage/review.phtml">
                    <block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="onepagecheckout/onepage/coupon.phtml"/>
                    <block type="onepagecheckout/agreements" name="checkout.onepage.agreements" as="agreements" template="onepagecheckout/onepage/agreements.phtml"/>
                    <block type="core/template" name="chronopost.pickmeshops.dropdown" as="pickme" template="chronopost_shipping/checkout/onepage/shipping_method/pickmeshopsdropdown.phtml"/>
                    <block type="checkout/onepage_review_info" name="info" template="onepagecheckout/onepage/review/info.phtml">
                        <action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>onepagecheckout/onepage/review/item.phtml</template></action>
                        <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>onepagecheckout/onepage/review/item.phtml</template></action>
                        <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>onepagecheckout/onepage/review/item.phtml</template></action>
                        <block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="onepagecheckout/onepage/review/totals.phtml"/>
                        <block type="core/text_list" name="checkout.onepage.review.info.items.before" as="items_before"/>
                    </block>
                </block>

And a little more info:

        <?php echo $this->getChildHtml('agreements') ?>
    <?php echo $this->getChildHtml('pickme') ?> 
            <?php if (Mage::helper('onepagecheckout')->isSubscribeNewAllowed()) : ?> 
        <p class="newsletter">
            <input type="checkbox" id="newsletter-signup" name="newsletter" value="1" title="<?php echo Mage::helper('newsletter')->__('Sign up for our newsletter') ?>" class="checkbox" />
            <label for="newsletter-signup">
                <?php echo Mage::helper('newsletter')->__('Sign up for our newsletter') ?>
            </label>
        </p>
    <?php endif; ?>

Best Answer

Some basic steps to go through

  • Check that caching and the compiler are turned of
  • Double check if the file exists and you got the path right (might be a small typo, who knows)
  • replace the type with core/template, if there's an issue with your block class this will prevent the template from showing up
  • Make sure the parent block is the right file, turn on template path hints to check this.

One of the above should turn up something useful nine out of ten times.

Related Topic