What is the type of block for the left column in a Magento theme?

I am working on a custom Magento theme (1.3) and want to add a left column.

I created the /page/html/left.phtml template using html.

In 2columns-left.phtml, I added the following:

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

The following has been added to page.xml:

<block type="page/html" name="left" as="left" template="page/html/left.phtml" />

What I do not quite understand is that this type of block should be - it works if I do page / html, core / template or page / html_header - what it is and what is the correct value for this case, where I I just want to include the phtml file effectively - page / html / left.phtml, etc.

Thank,

Yang

+5
source share
3 answers

This is a simplified version of what is happening, but will hopefully be enough for you to get started.

Special objects

, Magento "". , . Magento URI- , . ,

page/html

Block

Mage_Page_Block_Html

PHP, CSS.

Magento

HTML Magento.

- .

, Block Magento Mage_Core_Block_Template. Blocks - , phtml.

, "" XML, Magento.

foo/bar, baz.phtml

,

<!-- "name" and "as" are used to identify the block in the layout, so that 
PHP code can get a reference to the object. -->
<block type="foo/bar" name="myname" as="myname" template="path/to/baz.phtml" />

, , - ,

type="core/template"

, ,

type="page/html"

phtml

Mage_Page_Block_Html

, -

File: template.phtml

<a href="<?php echo $this->getBaseUrl();?>"></a>

core/template getBaseUrl, page/html .

( ), Block , Magento. , . , page/html .

+15

core/text_list, HTML.

XML:

<block type="core/text_list" name="left" as="left">
  <block type="core/text" name="test">
    <action method="setText"><text>Hello World</text></action>
  </block>
</block>
0

Block type for left column in magento theme

<block type="core/text_list" name="left" as="left" translate="label">
    <label>Left Column</label>
</block>
0
source

All Articles