0

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?

1
  • 1
    could you explain a bit the why for this? maybe there are better solutions which can make use of this div
    – Flyingmana
    Commented Aug 17, 2015 at 11:52

1 Answer 1

4

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') ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.