I'm creating a new Magento 1.7.0.2 module for the front end, but I can't get my one block to attach to any decent point of the page. Currently it's hiding down at the bottom of its page with all the default stuff up above it. I haven't really messed with the front end much, yet, so this is a fairly fresh Magento install. I've tried the reference tags, but if I include them currently my block disappears entirely no matter what I put in the name quotes.
My Layout:
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
</default>
<!--<reference name="root">-->
<makeorder_index_index>
<block type="makeorder/testblock" output="toHtml" name="orderdispaly"
template="makeorder/orderdisplay.phtml"/>
</makeorder_index_index>
<!--</reference>-->
</layout>
My current Template:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test Block</title>
</head>
<body>
<h2>Hello!</h2>
<div class="Test1">
<?php echo $this->displaystyles();?>
</div>
<br /><hr /><br />
<div class="test2">
<?php echo $this->displaypapers();?>
</div>
</body>
</html>
I would like to get the block into the middle of the page. Any help would be greatly appreciated, since I obviously am missing something important.
There are a couple of errors in your layout xml, but rather than correct them I would go this way as a start (unless there is a reason you want to recreate the full page layout in your own template?? )
Layout:
<?xml version="1.0"?>
<layout version="0.1.0">
<makeorder_index_index>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
<reference name="content">
<block type="makeorder/testblock" name="orderdispaly" template="makeorder/orderdisplay.phtml" />
</reference>
</makeorder_index_index>
</layout>
Template:
<h2>Hello!</h2>
<div class="Test1">
<?php echo $this->displaystyles();?>
</div>
<br /><hr /><br />
<div class="test2">
<?php echo $this->displaypapers();?>
</div>