Show label only if <title> is present
#1
I use the <title> tag for translated titles, and I'd like for it to appear only if its present (so a movie with <title></title> should display nothing). This is the expected behavior if I just use $INFO[ListItem.Title]  but I've included it on a parenthesis, so if there is no <title></title> you'll see ( ) instead of a blank space.

xml:
                     <label>[LOWERCASE]( $INFO[ListItem.Title] )[/LOWERCASE]</label>
                      <visible>String.Contains(ListItem.Title,Default)</visible>

It seems to be something like this. I tried variations of it but it doesn't work.
Reply
#2
code:
<visible>!String.IsEmpty(ListItem.Title)</visible>
Reply
#3
Thank you !
Reply
#4
BTW, another way to do this without the visibility condition is like so:
Code:
<label>$INFO[ListItem.Title,[LOWERCASE]( , )[/LOWERCASE]]</label>

Text after the first comma will be displayed before the label, and text after the second comma will be displayed after the label:
e.g. $INFO[ListItem.Title,Foo , Bar] = "Foo Title Bar"

This method has the added bonus of only showing the enclosing text when the infolabel is not empty.

It is particularly useful if you want to show multiple infolabels on the same line. For instance
Code:
<label>$INFO[ListItem.Genre,GENRE: , ]$INFO[ListItem.Director,DIRECTOR: , ]$INFO[ListItem.Year,YEAR: , ]</label>

If there is no director available then the above line will show:
GENRE: Action / Adventure YEAR: 2018
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply

Logout Mark Read Team Forum Stats Members Help
Show label only if <title> is present0