IF Statements (or something along that line)

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Kallaide Offline
Senior Member
Posts: 135
Joined: Apr 2010
Reputation: 0
Location: Victoria, Canada
Post: #1
Here's the issue:

I want to include one of the following

<include>Home_Random</include>
or
<include>Home_Random_Mod</include>

But not both. One is a modified version of mcborzu's IncludesHome_Random.xml file from his new Skin (Amazing BTW).

Anyways, I am trying to setup a Settings Option to select the use of this XML over the other. Changing the <include> is the best way I found how to achieve this however I have no idea how to link the following

<onclick>Skin.ToggleSetting(TV_Shows_Next_Aired)</onclick>

in the settings to the option of which <include> to use.

Can someone help me out or point me in the right direction please?
find quote
mcborzu Offline
Skilled Skinner
Posts: 3,381
Joined: Feb 2009
Reputation: 15
Location: dsf
Post: #2
Kind of confused on what you'd liked, but if I read it right, seems like what you are after is an "include condition" which is sort of like an if/else statement.

The below is an example in Night where I use one to determine whether to launch trailers small or fullscreen based on a settings a user has or has not checked:

PHP Code:
<include condition="!Skin.HasSetting(big_trailer)">ondown_small_trailer</include>
<include 
condition="Skin.HasSetting(big_trailer)">ondown_big_trailer</include> 

What above means is if !Skin.HasSetting(big_trailer) it'll use:
Quote:<include name="ondown_small_trailer">
<ondown>XBMC.PlayMedia($INFO[ListItem.Trailer],1,noresume)</ondown>
</include>

Or skin has Skin.HasSetting(big_trailer) then it'll use:

Quote:<include name="ondown_big_trailer">
<ondown>XBMC.PlayMedia($INFO[ListItem.Trailer],noresume)</ondown>
</include>

[Image: widget]

Check out The Carmichael - A Skin For XBMC

Check out Night - A Skin For XBMC

Check out Unfinished - A Skin For XBMC
find quote
Kallaide Offline
Senior Member
Posts: 135
Joined: Apr 2010
Reputation: 0
Location: Victoria, Canada
Post: #3
Read further... Sad
(This post was last modified: 2010-11-23 05:42 by Kallaide.)
find quote
Kallaide Offline
Senior Member
Posts: 135
Joined: Apr 2010
Reputation: 0
Location: Victoria, Canada
Post: #4
OK, fixed and all GOOD!!!

Thanks mcborzu!
(This post was last modified: 2010-11-23 07:11 by Kallaide.)
find quote