Magento – Add phtml before tag

layoutmagento-1.9

I want to add my phtml before </body> tag.

I m trying this code

<reference name="before_body_end">
    <block type="core/template" name="marketplace_player" template="magenetwork/list.phtml" />
</reference>

But this phtml add in wrapper class div i want that phtml exactly before </body> tag how can i do this?

Best Answer

You could try adding a new structural block and echo this out before the tag where you require.

<default>
    <reference name="root">
        <block type="core/text_list" name="my_before_body" as="my_before_body" translate="label">
            <label>My before body</label>
        </block>
    </reference>
    <reference name="my_before_body">
        <block type="core/template" name="marketplace_player" template="magenetwork/list.phtml">
    </reference>
</default>

You would then need to echo out this new structural block in your page templates before the body tag

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