Kodi Community Forum
Panel Container - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: Panel Container (/showthread.php?tid=28768)



Panel Container - skunkm0nkee - 2007-09-25

I was wondering if it is possible to do something like the following to conditionally show items in a panel or not?

Code:
<control type="panel" id="51">
  <posx>5</posx>
  <posy>140</posy>
  <width>450</width>
  <height>290</height>
  <orientation>vertical</orientation>

  <itemlayout height="70" width="220" [b]visible="Skin.String(ListItem.Year)"[/b]>
    <control type="image">
      <posx>10</posx>
      <posy>10</posy>
      <width>180</width>
      <height>70</height>
      <info>ListItem.Icon</info>
      <colordiffuse>ddffffff</colordiffuse>
      <aspectratio aligny="center">keep</aspectratio>
    </control>
  </itemlayout>

  <focusedlayout height="70" width="220">
    <control type="image">
      <posx>6</posx>
      <posy>2</posy>
      <width>200</width>
      <height>80</height>
      <info>ListItem.Icon</info>
      <colordiffuse>eeffffff</colordiffuse>
      <aspectratio aligny="center">keep</aspectratio>
    </control>
  </focusedlayout>
</control>

The example above would only show items in the panel if they had a year value. Is this possible and, if so, how?


- jmarshall - 2007-09-26

No, it's not.

XBMC determines what items to show in media lists. Not the skin. This (IMO) is how it should be.


- Jezz_X - 2007-09-26

The code you posted is not possible But I guess you trying not to put an item in if it dosn't have that value ? You can hide individual controls in the layouts based on conditions but not the whole layout plus visible="Skin.String(ListItem.Year)" is just a bogus condition and wont work if you are trying to check for ListItem.Year in the item


- jmarshall - 2007-09-26

We could add IsEmpty(<infolabel>) if that's going to be useful?


- Jezz_X - 2007-09-26

jmarshall Wrote:We could add IsEmpty(<infolabel>) if that's going to be useful?

Hell yes and for more that just panels and lists


- skunkm0nkee - 2007-09-26

Yep, sounds good to me too


- Jezz_X - 2007-09-26

he allready added it to the svn


- skunkm0nkee - 2007-09-26

Excellent, I guess that means that IsEmpty has been added as a new built in function but I won't be able to use it (or any other boolean) to conditionally display items in a panel/list?

I know the Skin.String(ListItem.Year) example, or IsEmpty(ListItem.Year) as it could be now, was a pretty trivial use of a condition but what I am hoping to do is have a view for the library that only lists tv shows which have episodes to watch. If the skin could control whether an itemlayout is visible or not then it would have been possible by checking the ListItem.Label2 value.

I guess if it's not possible to conditionally hide them I can look at de-emphasising them instead (using the new IsEmpty function)

As an aside I thought the Skin.String(str) function returned true if str contained a value? I thought another version was added that allowed you to pass an optional 2nd variable, Skin.String( str1, str2 ), so it would return true if the 2 strings matched.


- Nuka1195 - 2007-09-26

Are all ListItem.* infolabels empty when no info is found?

I'm specifically refering to the movie information window, when no information is found. There still is text in the infolabel.

Maybe now would be a good time to eliminate formatted infolabels and let the skinner handle that?


- skunkm0nkee - 2007-09-26

Nuka1195 Wrote:Are all ListItem.* infolabels empty when no info is found?

I'm specifically refering to the movie information window, when no information is found. There still is text in the infolabel.

I think that they are generally blank if no info is found (although I do have some Years showing up as 1601 when there is no year but I think that is an issue with some of the entries in my database!)

Which fields do you see data in on the movie information window when there isn't any? (and what do you see?)