Kodi Community Forum

Full Version: Displaying original title and title
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
On a list of movies, I want to display their name as <originaltitle>, unless <title> is present, in which case it should display <title> instead. How do I do that?

xml:
                            <control type="label">
                                <aligny>center</aligny>
                                <left>250</left>
                                <width>580</width>
                                <font>Bold42</font>
                                <textcolor>FFFFFFFF</textcolor>
                                <selectedcolor>FFFFFFFF</selectedcolor>
                                <label>$INFO[ListItem.OriginalTitle]</label>
                                <textwidth>580</textwidth>
                                <scroll>false</scroll>
                            </control>

Is what I have, halfway there. It displays all the names as <originaltitle>, but those that only have a <title> return nothing, obviously.
Using a variable replace <label>$INFO[ListItem.OriginalTitle]</label> with <label>$VAR[Title]</label> and then add this to your includes.xml.

xml:
<variable name="Title">
    <value condition="!String.IsEmpty(ListItem.OriginalTitle)">$INFO[ListItem.OriginalTitle]</value>
    <value>$INFO[ListItem.Title]</value>
</variable>
Perfect! Thank you so much.