---
title: mainTemplate
framework: tvml
role: collectionGroup
path: tvml/maintemplate
---

# mainTemplate

Displays user options for a media item.

## Overview

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.

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 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:

## Topics

### Valid TVML Attributes

- [binding](tvml/binding.md)
- [layoutDirection](tvml/layoutdirection.md)
- [prototype](tvml/prototype.md)
- [theme](tvml/theme.md)

## See Also

### Full-Page Templates

- [alertTemplate](tvml/alerttemplate.md)
- [catalogTemplate](tvml/catalogtemplate.md)
- [compilationTemplate](tvml/compilationtemplate.md)
- [descriptiveAlertTemplate](tvml/descriptivealerttemplate.md)
- [divTemplate](tvml/divtemplate.md)
- [formTemplate](tvml/formtemplate.md)
- [listTemplate](tvml/listtemplate.md)
- [loadingTemplate](tvml/loadingtemplate.md)
- [menuBarTemplate](tvml/menubartemplate.md)
- [oneupTemplate](tvml/oneuptemplate.md)
- [paradeTemplate](tvml/paradetemplate.md)
- [productBundleTemplate](tvml/productbundletemplate.md)
- [productTemplate](tvml/producttemplate.md)
- [ratingTemplate](tvml/ratingtemplate.md)
- [searchTemplate](tvml/searchtemplate.md)
