Conditional visibility when image cant be loaded
#1
Hi!

I have an URL of a logo set in a variable

Code:
<variable name="TVShowLogoVar">
    <value condition="Container.Content(tvshows)|Container.Content(seasons)">$INFO[ListItem.path,,logo.png]</value>
    <value condition="Container.Content(episodes)">$INFO[ListItem.path,,../logo.png]</value>
    <value condition="Container.Content(movies)">$INFO[ListItem.Path,,logo.png]</value>
  </variable>

and use this variable to display an image.
Now I want to display a label if the image does not exist.

How do I achieve that? I did not find anything in the wiki that would fit my needs..

Edit:\ I already have the image showing up and the label too. I just need that visibilty-part. I already tried to check for !$VAR[TVShowLogoVar] but this is a dead end
Reply
#2
Not possible afaik
Reply
#3
Add an id to your image, set fallback to i.e. empty.png and use stringcompare(Control.GetLabel(id)) as visibility condition in your label.
Image
Reply
#4
Thanks for your help!

Like this Huh

Code:
<control type="image" id="tvShowLogo">
          <posx>945</posx>
          <posy>100</posy>
          <width>175</width>
          <height>70</height>
          <aspectratio>stretch</aspectratio>
          <texture background="true" fallback="common/blank.png">$VAR[TVShowLogoVar]</texture>
          <fadetime>300</fadetime>
          <aspectratio align="bottom">keep</aspectratio>
          <animation effect="fade" start="100" end="0" time="200">Hidden</animation>
          <animation effect="fade" start="0" end="100" time="400">Visible</animation>
          <visible>!Skin.HasSetting(InfoWallTitle)</visible>
        </control>
        <control type="label">
          <posx>840</posx>
          <posy>103</posy>
          <height>13</height>
          <width>400</width>
          <font>Font_Bold25_Caps</font>
          <textcolor>white2</textcolor>
          <scroll>true</scroll>
          <label>[UPPERCASE]$INFO[ListItem.Label][/UPPERCASE]</label>
          <visible>Skin.HasSetting(InfoWallTitle)|StringCompare(Control.GetLabel(tvShowLogo),common/blank.png)</visible>
        </control>

I also tried using substring and moved the id from the control to the texture and now I don't have any more ideas..
Reply
#5
The id needs to be a number.
Reply
#6
Great!

Thank you all (:
Reply

Logout Mark Read Team Forum Stats Members Help
Conditional visibility when image cant be loaded0