Req Conditional <top> tag?
#1
Hi,

I'm trying to set the position of a control's height based on a condition. I've noticed that this is not possible:

PHP Code:
<top condition="Container.Content(TVShows)">120</top>
<
top condition="!Container.Content(TVShows)">80</top

Are there any other ways that achieve this without the use of variables?

If it's not possible, could this be considered as a feature request? It seems like a no brainer to me to be able to set a condition parameter to the position tags seeing as it is possible to do this with many other tags. The use of a variable seems unnecessarily verbose for writing code and the general tidiness/maintenance for skinning.

Also, does anyone have a full list of the parameters that are available for control position tags such as <top>,<left>, <right> etc? The Wiki doesn't seem to have any information on this as I've noticed it's possible to have "min" and "max" parameters and was wondering what else is available.

Would appreciate any help/advice.

Thanks Wink
Reply
#2
http://kodi.wiki/view/Skinning_Manual#Us...n_includes

Definition include:
Code:
<include name="MyInclude">
  <control type="group">
    <top>$PARAM[top]</top>
    <left>$PARAM[left]</left>
    .....
  </control>
</include>

Call the include with your parameters:
Code:
<include condition="Container.Content(TVShows)" name="MyInclude">
  <param name="top">120</param>
  <param name="left">80</param>
</include>

<include condition="!Container.Content(TVShows)" name="MyInclude">
  <param name="top">80</param>
  <param name="left">80</param>
</include>
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#3
Or use a slide animation.

PHP Code:
<animation effect="slide" start="0,0" end="0,-20" time="0" condition="!Container.Content(TVShows)">Conditional</anaimation
Reply
#4
(2016-02-28, 19:27)sualfred Wrote: Call the include with your parameters:
Code:
<include condition="Container.Content(TVShows)" name="MyInclude">
  <param name="top">120</param>
  <param name="left">80</param>
</include>

<include condition="!Container.Content(TVShows)" name="MyInclude">
  <param name="top">80</param>
  <param name="left">80</param>
</include>

Container.Content() shouldnt be used for include conditions. I think Hitcher's suggestion is the way to go.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#5
Yep. Better and even shorter solution.
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#6
Thanks guys! That's a creative way of doing it Hitcher, never thought about using animations to achieve this. Cool

I'll be trying out Hitcher's solution for now as it's shorter, but good to know of an alternative.

Also, I'd still like to see a condition parameter for control position tags added into Kodi, as using animations is still really a workaround.

Cheers guys Wink
Reply

Logout Mark Read Team Forum Stats Members Help
Conditional <top> tag?0