Kodi Community Forum

Full Version: Visibility for Listitem.Studio
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all, i want to display an alternative label for ListItem.Studio if the label is not found, then show a fallback image "Default.png".
My test code:

PHP Code:
                    <control type="image" id="1000">
                        <
width>96</width>
                        <
height>64</height>
                        <
aspectratio align="center">keep</aspectratio>
                        <
texture fallback="flags/studios/Default.png">$INFO[Listitem.Studio,flags/studios/,.png]</texture>
                    </
control>
                    <
control type="label">
                        <
width>200</width>
                        <
height>64</height>
                        <
align>left</align>
                        <
label>$INFO[ListItem.Studio]</label>
                        <
font>condensed_20-U</font>
                        <
textcolor>Color9</textcolor>
                        <
wrapmultiline>true</wrapmultiline>
                        <
visible>Control.GetLabel(1000) + SubString(Control(1000),Default.png)</visible>
                    </
control

Obviously, my code is wrong, no label for ListItem.Studio is displayed. Only the fallback image.
Can someone helps me? Thanks.
Like you have done with the texture fallback you can provide a label fallback in the <label> tag, e.g.

<label fallback="unknown studio">$INFO[ListItem.Studio]</label>
Thank you Eddage, surely I have not explained well.
My goal is to show the label for ListItem.Studio if the corresponding icon in flags/studios is not found.
Shouldn't that be -

PHP Code:
<visible>SubString(Control.GetLabel(1000),Default.png)</visible
Yes, Master Hitcher, it works perfectly.
I did not think of combining toghether control.getLabel and substring
Thank you very much.