Contents

mainTemplate

Displays user options for a media item.

Overview

Use the mainTemplate element to display options to the user; for example, the main page for a movie with options to play the movie, see extra content, and jump to specific scenes. The background area contains an image relating to the product, and the options are contained in a menu bar along the bottom of the screen. The following figure shows the basic layout for a mainTemplate page. The default theme for a main template is dark.

[Image]

Main Elements

The following listing shows the elements of the mainTemplate element in TVML format.

<mainTemplate>
    <background>…</background>
    <menuBar>
        <section>
            <menuItem>…</menuItem>
            <menuItem>…</menuItem>
        </section>
    </menuBar>
</mainTemplate>

Element Descriptions

background

The background elements used on the page, such as audio.

menuBar

A list of displayed menu items.

menuItem

Information for an individual menu item.

section

An area containing a group of menu items.

Example

The following listing shows the TVML for a mainTemplate example. The example displays a full-screen image as the background. A menu bar contains three navigable options.

<document>
    <mainTemplate>
        <background>
            <img src="path to images on your server/Car_Movie_1920x1080" />
        </background>
        <menuBar>
            <section>
                <menuItem>
                    <title>PLAY</title>
                </menuItem>
                <menuItem>
                    <title>SCENES</title>
                </menuItem>
                <menuItem>
                    <title>EXTRAS</title>
                </menuItem>
            </section>
        </menuBar>
    </mainTemplate>
</document>

The following figure shows the output for the above example:

[Image]

Topics

Valid TVML Attributes

See Also

Full-Page Templates