How do I display dynamic value in Label fallback?
#1
Hi guys,


I have the following code:

PHP Code:
<label fallback="Season ListItem.Season Episode: (ListItem.Episode)">$INFO[ListItem.Tagline]</label

The problem is that the fallback text appears exactly as it is in the quotes, like this:
Quote:Season ListItem.Season Episode: (ListItem.Episode)

I'd like to know how I can display the real values of the Season and Episode ListItems instead of being statically displayed. I've tried removing the quotes and also tried different variations of inserting ListItem but have had no luck. Undecided

Would appreciate anyone's help.

Thank you. Wink
Reply
#2
it's not possible to use infolabels as a fallback.

you could use a variable instead though.

Code:
<label>$VAR[MyLabel]</label>

<variable name="MyLabel">
    <value condition="!IsEmpty(ListItem.Tagline)">$INFO[ListItem.Tagline]</value>
    <value>Season $INFO[ListItem.Season] Episode: ($INFO[ListItem.Episode])</value>
</variable>
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
(2016-01-03, 15:49)ronie Wrote: it's not possible to use infolabels as a fallback.

you could use a variable instead though.

Code:
<label>$VAR[MyLabel]</label>

<variable name="MyLabel">
    <value condition="!IsEmpty(ListItem.Tagline)">$INFO[ListItem.Tagline]</value>
    <value>Season $INFO[ListItem.Season] Episode: ($INFO[ListItem.Episode])</value>
</variable>

Thanks Ronie, much appreciate for the help and writing the code. Works perfectly fine. Is it possible to define the variable and use it in the same xml file instead of defining it in a seperate xml (e.g. includes.xml) as is usually the case? I've tried to do this but it doesn't seem to work, so i'm guessing it's not possible?
Reply
#4
nope, not possible indeed.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
it depend on which file you are trying to put that code, you need to put your
variables and includes inside a file that included in the includes.xml file head.
for example:
Code:
<includes>
    <include file="defaults.xml" />
    <include file="Includes_Variables.xml" />
..
.
so you can put it inside "defaults.xml" file or whatever file you want..
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
#6
I already answered this on IRC/Slack. Wink
Reply

Logout Mark Read Team Forum Stats Members Help
How do I display dynamic value in Label fallback?0