Documentation Archive

Developer

Apple TV Markup Language Reference

On This Page

ratingTemplate

Use the rating template (ratingTemplate) to display a rating for an item. Figure 16-1 shows the basic layout for a ratingTemplate page. The theme for the rating template defaults to the system preference.

Figure 16-1Rating template image: ../Art/ATV_temps_rating_2x.png

Main Elements of the Rating Template

Listing 16-1 shows the main elements in TVML format, and Table 16-1 describes the main elements.

Listing 16-1ratingTemplate TVML format
  1. <document>
  2. <ratingTemplate>
  3. <title>…</title>
  4. <ratingBadge></ratingBadge>
  5. </ratingTemplate>
  6. </document>

Table 16-1ratingTemplate element descriptions

Element name

Description

ratingBadge

The rating for the item.

title

The title for the rated item.

Rating Template Example

Listing 16-2 shows the TVML for a ratingTemplate example. The example displays a title and a set of rating badge images, such as stars. The filled rating badge images indicate the current rating for that title. The value attribute indicates that the example title has an 80 percent favorable rating, or 4 of 5 stars. Figure 16-2 shows the output of the rating template example.

Listing 16-2ratingTemplate example TVML
  1. <document>
  2. <ratingTemplate>
  3. <title>WWDC Roadtrip</title>
  4. <ratingBadge value="0.8"></ratingBadge>
  5. </ratingTemplate>
  6. </document>
Figure 16-2ratingTemplate example output image: ../Art/ratingTemplateSS_2x.png