We use layouts to specify the physical position of elements on pages. To display content on a range of devices you need to specify a layout policy that contains variants that are suitable for different device characteristics.
We use layouts to specify the physical position of elements on pages. To display content on a range of devices you need to specify a layout policy that contains variants that are suitable for different device characteristics.
In this module we create three layout policies used by the Weather page and the Homepage.
Choose File | New and pick the Layout wizard from the Mobile Portal Toolkit menu.
The layout policy should be located in the policies/layouts directory. Choose that folder in the policy tree view, or enter its full path in the first text box.
Name the new layout 'main_cf2t' and then click the Next button. The MCS wizard automatically adds .mlyt layout file extension to the file name.
Most variants are device specific, targeted at a particular device or device family. However, we will not create a device specific layout. We will set selection criteria to 'Default', instead. Please refer to the Getting started with MCS tutorial to learn about device specific variants.
Choose Default in the Selection Criteria box.
Click the Finish button to complete the process.
The Layout Editor has two pages, an Overview page listing the device layouts and their general attributes, and a Design page where you can develop your layout.
When designing a layout you start by creating a grid that defines the main structure of the page. Next, you add elements such as panes and regions, which hold targeted XDIME page content.
Grids give a page layout the basic structure for your content. You can nest grids inside one another, and also wrap one grid element in another.
Make sure the main_cf2t.mlyt layout is opened in the Layout Editor.
Pick the 'Default' variant from the list of variants and click on the Design tab.
Right-click on the Design Layout area and pick Add | Grid | N by M....
Create a 3 rows by 1 column grid.
MCS displays page content in the individual panes, each of which must have a unique name within the layout. In the XDIME, you use the pane names to specify where the content of the file should appear.
Right-click on the row of the grid and pick Add | Pane | Pane. Name the new pane 'title'.
Leave the second row of the grid untouched for now.
The third pane should be named 'footer'.
Each web page is a template with some common content. Those common elements are represented by panes. In addition, a web page may include a set of areas that can be occupied by variable content. Those areas are called regions.
Right-click on the second row of the grid and pick Add | Region.
Name the new region 'content'. The layout should have the following form.

When you select a layout format in the layout Design view or Outline view, you can set different combinations of attributes, depending on the format.
Click on the pane or region you want to set the format attributes for.
In the Format Attributes window set its attributes, starting with the name.
Set the format attributes for the remaining panes and regions. The table in the following section lists all the attributes and their values.
These are the format attribute values that you need to set for the panes and regions in the main layout.
| Name | Width | Border Width | Cell Padding | Cell Spacing | Markup Optimization | Filter Usability Below | Column Width |
|---|---|---|---|---|---|---|---|
| title | 100% | 0 | 0 | 0 | Never | 0 | |
| content | n/a | n/a | n/a | n/a | n/a | n/a | |
| footer | 100% | 0 | 0 | 0 | Never | 0 |
Follow the steps outlined previously and create two additional layouts.
The ui_cf2t.mlyt policy should look like the one following example:

| Name | Width | Border Width | Cell Padding | Cell Spacing | Markup Optimization | Filter Usability Below | Column Width |
|---|---|---|---|---|---|---|---|
| ui-header | n/a | n/a | n/a | n/a | n/a | n/a | 100% |
| ui-content | n/a | n/a | n/a | n/a | n/a | n/a | 100% |
| ui-footer | 100% | 0 | 0 | 0 | Never | 0 | 100% |
The biscuit-tmpl_cf2t.mlyt policy should look like the following example:

| Name | Width | Border Width | Cell Padding | Cell Spacing | Horizontal Alignment | Markup Optimization | Filter Usability Below | Column Width |
|---|---|---|---|---|---|---|---|---|
| icon | 100% | 0 | 0 | 0 | Never | 0 | ||
| details | 100% | 0 | 0 | 0 | Left | Never | 0 | 100% |
| indicator | 100% | 0 | 0 | 0 | Never | 0 |