home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Support
General Support
Latest Media Handler - facade properties - itemcount
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="CyberSimian" data-source="post: 1259011" data-attributes="member: 141969"><p>I have not tried using "Latest Media Handler" in my skin, so there may be some specific restrictions that apply. However, #itemcount is notorious for being unset in various circumstances (so you may have found another one).</p><p></p><p>Below is the xml that I use to generate the item count string (top left corner in my skin); the comments explain why this logic is necessary:</p><p></p><p><!-- ====================================================================</p><p> The built-in variables "#selectedindex" and "#itemcount" have incorrect</p><p> values on some panels. To avoid bad labelling appearing on the panel, we</p><p> use the following algorithm, where "(null)" represents the zero-length</p><p> string, and "n" and "m" are integers:</p><p>[code]#selectedindex #itemcount label_shown</p><p> (null) (null) (none)</p><p> (null) 0 0 items</p><p> (null) n n items</p><p> 0 (null) (none)</p><p> 0 0 0 items</p><p> 0 n n items</p><p> n (null) Item n</p><p> n 0 Item n</p><p> n m Item n/m[/code]</p><p> In addition, when the context menu is on the screen, "#selectedindex"</p><p> is the index of the highlighted item in the context menu, and not the</p><p> index of the item in the list. So when the context menu is visible, we</p><p> display the null string or "n items", as appropriate.</p><p> ===================================================================== --></p><p> <label>#(switch(</p><p> and(eq(#currentmodule,L(102012)),eq(#itemcount,'')),'',</p><p> eq(#currentmodule,L(102012)),'#itemcount items',</p><p> and(eq(#selectedindex,''),eq(#itemcount,'')),'',</p><p> and(eq(#selectedindex,'0'),eq(#itemcount,'')),'',</p><p> or(eq(#selectedindex,''),eq(#selectedindex,'0')),'#itemcount items',</p><p> or(eq(#itemcount,''),eq(#itemcount,'0')),'Item #selectedindex',</p><p> eq(1,1),'Item #selectedindex/#itemcount'))</label></p><p></p><p>So there you have it. Simples! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin :D" loading="lazy" data-shortname=":D" /></p><p></p><p>-- from CyberSimian in the UK</p></blockquote><p></p>
[QUOTE="CyberSimian, post: 1259011, member: 141969"] I have not tried using "Latest Media Handler" in my skin, so there may be some specific restrictions that apply. However, #itemcount is notorious for being unset in various circumstances (so you may have found another one). Below is the xml that I use to generate the item count string (top left corner in my skin); the comments explain why this logic is necessary: <!-- ==================================================================== The built-in variables "#selectedindex" and "#itemcount" have incorrect values on some panels. To avoid bad labelling appearing on the panel, we use the following algorithm, where "(null)" represents the zero-length string, and "n" and "m" are integers: [code]#selectedindex #itemcount label_shown (null) (null) (none) (null) 0 0 items (null) n n items 0 (null) (none) 0 0 0 items 0 n n items n (null) Item n n 0 Item n n m Item n/m[/code] In addition, when the context menu is on the screen, "#selectedindex" is the index of the highlighted item in the context menu, and not the index of the item in the list. So when the context menu is visible, we display the null string or "n items", as appropriate. ===================================================================== --> <label>#(switch( and(eq(#currentmodule,L(102012)),eq(#itemcount,'')),'', eq(#currentmodule,L(102012)),'#itemcount items', and(eq(#selectedindex,''),eq(#itemcount,'')),'', and(eq(#selectedindex,'0'),eq(#itemcount,'')),'', or(eq(#selectedindex,''),eq(#selectedindex,'0')),'#itemcount items', or(eq(#itemcount,''),eq(#itemcount,'0')),'Item #selectedindex', eq(1,1),'Item #selectedindex/#itemcount'))</label> So there you have it. Simples! :D -- from CyberSimian in the UK [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
General Support
Latest Media Handler - facade properties - itemcount
Contact us
RSS
Top
Bottom