Search code examples
tvosapple-tvtvmltvjs

Change text size of a description in a compilationTemplate's relatedContent area


I'm trying to add a description to a compilationTemplate's itemBanner in relatedContent. My current template is as follows:

var Template = function() { return `<?xml version="1.0" encoding="UTF-8" ?>
    <document>
        <compilationTemplate theme="light">
            <list>
                <relatedContent>
                    <itemBanner>
                        <heroImg src="${this.BASEURL}images/someImage.jpg" />
                        <description>lorem ipsum dolor sit amet consectetur adipiscing elit</description>
                    </itemBanner>
                </relatedContent>
                <header>
                    <title>Some Show</title>
                    <subtitle>Season 4</subtitle>
                    <row>
                        <text>Drama</text>
                        <text>5 Episodes</text>
                        <text>2015</text>
                    </row>
                </header>
                <section>
                    <listItemLockup>
                        <ordinal minLength="2">1</ordinal>
                        <title>A Danger to Himself and Others</title>
                        <decorationLabel>11:14</decorationLabel>
                    </listItemLockup>
                </section>
            </list>
        </compilationTemplate>
    </document>`
}

This does add text to the itemBanner where the buttonLockup items would normally exist, but the text is tiny.

template

How can I change the size and position of this description in the itemBanner?


Solution

  • This is possible by adjusting the font-size attribute in the style tag:

    <description style="tv-text-style: none; font-size:36; font-weight:regular;">lorem ipsum dolor sit amet consectetur adipiscing elit</description>
    

    This doesn't wrap the text for you though.

    appletv

    I've asked a new question about the line wrapping here:

    Line Wrap description text in a compilationTemplate's relatedContent area in TVML