I created a new custom block and added it to the before_body_end block.
When I look in my pages’ source code, nothing appears from my custom block.
Could you help me debug this please ?
In my module layout XML file :
<layout version="0.1.0">
<default>
<reference name="before_body_end">
<block type="tankchat/js_view" name="tankchat.js.view" as="tankchat" template="tankchat/js/view.phtml" />
</reference>
</default>
</layout>
Nothing special in my Company_Tankchat_Block_Js_View class, only some “getData” functions.
And my phtml is located at app/design/frontend/company/default/template/tankchat/js/view.phtml and yes it’s the good package and theme etc.
Do I need to add somewhere a echo $this->getChildHtml('tankchat') ? I think I don’t because my custom block is passed to before_body_end, but maybe I’m wrong ?
Any help will be highly appreciated !
Ok I finally found out what was wrong :
I made a mistake declaring my layout file, it need to be done in
frontendnode, not inglobal! :The file wasn’t even opened by the app…
But I also forgot to declare the blocks prefix in my module config file :
The block class wasn’t found by autoloader…
Hope this will help someone in the future…