Kodi Community Forum
Solved ? $PARAM not working with constants ? - 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: Solved ? $PARAM not working with constants ? (/showthread.php?tid=265437)



? $PARAM not working with constants ? - Jayz2K - 2016-03-22

Noticed that $PARAM is not working for constants :

According the wiki : http://kodi.wiki/view/Skinning_Manual#Use_params_in_includes

Quote:Any appropriate value can be passed as parameter in the new include call, including $INFO labels, $LOCALIZE, $VARs, constants, etc. Empty string (value="") can also be passed, for example to override a non-empty default value set in the include definition.

Code:
<constant name="Value1">200</constant>
<constant name="Value2">400</constant>

<include name="Constant1Test" condition="Mycondition1">
     <param name="left" value="Value1" />
</include>

<include name="Constant1Test" condition="Mycondition2">
     <param name="left" value="Value2" />
</include>

But this doesnl't work :

Code:
<include name="Constant1Test">
     <control type="image">
          <left>$PARAM[left]</left>
          ...
     </control>
</include>

Can someone please confirm ? (Using KRYPTON)

PS : this is a summary of a whole process using cascading params, so just FYI using the following is not relevant in my case (but works) :

Code:
<include name="Constant1Test" condition="Mycondition1">
     <left>Value1</left>
</include>

<include name="Constant1Test" condition="Mycondition2">
     <left>Value2</left>
</include>

Thx


RE: ? $PARAM not working with constants ? - Jayz2K - 2016-03-29

Sry to bump but do I have to open a trac ticket for this or is this normal behavior ? Tried everything but I still don't get it working.


RE: ? $PARAM not working with constants ? - ronie - 2016-03-31

works ok on my end.

you're not mixing up include definitions and include references are you?
the way you've quoted your code above makes me think so.


RE: ? $PARAM not working with constants ? - Jayz2K - 2016-03-31

(2016-03-31, 01:26)ronie Wrote: works ok on my end.

you're not mixing up include definitions and include references are you?
the way you've quoted your code above makes me think so.

Thx for testing Ronie. That's at least good news.
I don't think I mixed up defs and refs ... I tried replacing the constant name in def by a numeric value and it worked. Also, tried to place the constant name directly in ref and worked too. That's why it made me think about $PARAM handling in pos / size tags.

So I will revert back my changes to make another try ... and rewrite it from scratch in Notepad instead of sublimetext.
Will keep you in touch then.


RE: ? $PARAM not working with constants ? - sualfred - 2016-03-31

@Jayz2K

Do you have any expluded lines such "<!-- Description -->" in the $PARAMs ?
They will break the $PARAM function for some reasons.


RE: ? $PARAM not working with constants ? - Jayz2K - 2016-03-31

(2016-03-31, 10:43)sualfred Wrote: @Jayz2K

Do you have any expluded lines such "<!-- Description -->" in the $PARAMs ?
They will break the $PARAM function for some reasons.

Yes I did ...

So made a full rewrite with Notepad+ and seems to work now. It's one more time a weird bug.
I was about to give up, so thanks for taking time to test on your side and confirming it's working.

Sooo now, just missing a $CONSTANT[] infolabel to retrieve the value Smile