Panel Container
#1
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?
Reply
#2
No, it's not.

XBMC determines what items to show in media lists. Not the skin. This (IMO) is how it should be.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
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
Reply
#4
We could add IsEmpty(<infolabel>) if that's going to be useful?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


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

Hell yes and for more that just panels and lists
Reply
#6
Yep, sounds good to me too
Reply
#7
he allready added it to the svn
Reply
#8
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.
Reply
#9
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?
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#10
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?)
Reply

Logout Mark Read Team Forum Stats Members Help
Panel Container0