-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlayout.xml
187 lines (141 loc) · 4.85 KB
/
layout.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<?xml version="1.0" encoding="UTF-8"?>
<!--
All layout files will be merged together into one big xml structure
Add new files to be merged be configuring them in config.xml under
config/frontend/layout/updates/<customKey>/file: filename
-->
<layout version="0.1.0"><!-- root node -->
<!-- TODO: what effect has "version"? -->
<default translate="label" module="page">
<!--
This is the default handle that is always loaded. Most configuration that is valid for all parts of the
shop will be configured here
-->
<!-- TODO: describe attributes label and module -->
<!--
Basic directives
- block: Block declaration
- action: Allows to call any method from target block
- reference: Reference's content will be merged into target block. Attribute "name" specifies the referenced block name
- update: merge to the current handle all directives from target handle
- remove: set ignore flag for the target block
- label: (used in adminhtml only?)
-->
<block type="page/html" name="root" output="toHtml" template="page/3columns.phtml">
<!--
Required attributes for the <block>:
- type/class Block class name, which used for factory method
- name A name by which other blocks can make reference to this block
Optional attributes:
- as Block alias name
- parent Parent block name. Used for adding current block into specified parent block (can also be done using nesting)
- output Method for block output rendering. E.g. "toHtml"
TODO: what other values are possible here?
For core/test_list parent blocks
- before Block name or "-". Used for adding current block before the block specified
- after Block name or "-". Used for adding current block after the block specified
For core/template parent blocks
- template Template (*.phtml) file path
-->
<!--
Difference between name and alias
The alias must be unique inside the parent block.
$this->getLayout()->getBlock($name);
$this->getLayout()->getBlock(...)->getChild($alias);
-->
<!-- Blocks can be nested: -->
<block type="page/html_head" name="head" as="head">
<!--
Actions directive
@see Mage_Core_Model_Layout::_generateAction()
-->
<!--
Will result in:
$block = Mage::app()->getLayout()->createBlock('page/html_head', 'head');
if (Mage::getStoreConfigFlag('dev/js/deprecation')) {
$block->addJs('prototype/deprecation.js');
}
-->
<action method="addJs" ifconfig="dev/js/deprecation">
<!--
Required attribute
- method block method name
Optional attributes
- translate attribute used for method arguments translation
- module Module name used to instantiate helper for translation. Defaults to Mage_Core
- helper helper name with helper method
- json json values which need to be decoded
- ifconfig check configuration first
-->
<!--
TODO: add example for json processing
-->
<param1>prototype/deprecation.js</param1>
<!--
<tag>-enclosed text nodes inside <action> will be passed in order to the method. The name of the
tag is not of any importance. Add empty tags if you need to skip a parameter.
-->
</action>
<!--
Will result in
$block->setFooArray(
'foo',
array(
'key1' => 'value1',
'key2' => 'value2',
)
);
-->
<action method="setFooArray">
<param1>foo</param1>
<param2>
<key1>value1</key1><!-- Tag name will be used as array key -->
<key2>value2</key2>
</param2>
</action>
</block>
<!--
Remove directive
Once a block has been removed it won't be rendered anywhere for this request.
Note: compare to unsetChild
-->
<remove name="right" />
</block>
<!--
Action can also be configured outside blocks:
TODO: how to refer to parent block?
-->
<action method="addJs" >
<param1>prototype/deprecation.js</param1>
</action>
<!--
Referencing another block and add configuration to that one
-->
<reference name="left">
</reference>
</default>
<!-- ===============================
Dynamic handles
================================ -->
<!--
Store specific:
@see Mage_Core_Controller_Varien_Action::addActionLayoutHandles()
'STORE_'.Mage::app()->getStore()->getCode()
-->
<STORE_code>
</STORE_code>
<!--
Theme specific
@see Mage_Core_Controller_Varien_Action::addActionLayoutHandles()
'THEME_'.$package->getArea().'_'.$package->getPackageName().'_'.$package->getTheme('layout')
-->
<THEME_area_package_theme><!-- e.g. THEME_frontend_base_default -->
</THEME_area_package_theme>
<!--
Full action name
@see Mage_Core_Controller_Varien_Action::addActionLayoutHandles()
strtolower($this->getFullActionName())
-->
<full_action_name><!-- e.g. catalog_category_view -->
</full_action_name>
</layout>