blocks.xml layout rules

block.xml file is a tool to customize your site pages. It should be placed in the root directory of your theme. By adding xml-rules in it you can define content block position on page and pages to which this content block should be added. TODO: write more about possibilities here. E.g. about custom layout definition

Here you can see a blocks.xml file example. Listed set of xml-rules produces markup for the structural blocks of every single page. Please, notice:

blocks.xml file structure

Root tag of blocks.xml file is data. It is objligatory.

blocks_definition section

At blocks_definition section you can set rules to define content blocks placement inside of structural blocks. If you want some content block to be placed in the structural block, you should add the structural block section called blocks, and put content_block section inside of it. (Each content block can be assigned to one or more structural blocks. Also one blocks section can contain many content_block sections) Using blocks section attributes, you can also specify pages and pages parts, for which the content block should be displayed.

blocks section attributes are:

structural_block attribute is always required. If you'll specify only structural_block attribute without controller and action attributes - content blocks of current blocks section will be shown on each webshop page. If you'll specify both structural_block and controller attributes, the content block will be shown for all actions, grouped under this controller. To show the content blocks only for some particular page — you should specify all three attributes: structural_block, controller and action. Please remember, adding structural_block and action attributes without specifying controller attribute is wrong!

content_block section has only one attribute:

Value for position isn't strictly defined. You only have to ensure blocks, you want to be shown before, have lower position. Inside of content_block section should be content block name. If you want to hide the content block for specified structural block, you should add content_block section where the content block name be beginning with ! symbol. You can see this type of rule in examples below.


layouts_definition section

Your theme in Notando template engine should have main.phtml layout template, used as default. Also you can set particular layout template for some page or group of pages. They can be specified with page rules inside of layouts_definition section.

page attributes:

The rules of using controller and action attributes for page section is the same as for blocks section (Read more about rules)


settings section

There are possiblitity to customize the following settings:

You can see example of settings specifying in blocks.xml file example above.

Theme metadata

You can provide some additional information about your theme. This information will be available for users at theme selection interface in webshop backoffice. To do this create metadata.xml file in your theme root folder. Here you can see metadata.xml file example. Please notice, file can contain only name, author, version, description and fallback_theme sections, and must contain all of them. If you want to ommit some metadata, just put empty string inside of necessary section.

fallback_theme is not required and has to be used ONLY in the case when you want to inherit your theme from theme different from common/default.
fallback_theme may be
-one of our common themes (common/default, common/gray, common/luggage, common/business_today). Prefix common/ is necessary for common themes;
- the name of your theme without any prefixes (for example you have theme named store and you want to create it's spring variation. Then you'll create spring theme as described in this documentation and add into it's metadata.xml next section <fallback_theme><![CDATA[store]]></fallback_theme>

We support 1 level inheritance at this moment. This mean that if some template will not be found in your 1 level template it will be taken from common/default theme.