Posts: 19
Joined: Oct 2012
Reputation:
3
2014-06-21, 13:51
(This post was last modified: 2014-06-21, 14:12 by rahotep.)
I was initially considering this and am not against it. It would be interesting to hear what others think.
Capitalized attributes are also a kind of a 'namespace', but implicit, and with minimum "overhead". Perhaps a less verbose form 'p:' instead of 'param:' could be used?
Anyway, good news is that include parameters feature has been implemented and is waiting to be included.
Posts: 19
Joined: Oct 2012
Reputation:
3
I may be wrong, but I think the comment about readability was directed towards $PARAM[Name] references themselves and entire 'include with parameters' feature.
Anyway, one issue with your latest approach could be possible overlapping with built-in dollar references (both current - $VAR, $INFO, $ESCINFO, $LOCALIZE, $ADDON, $NUMBER etc. - and future ones), which we wanted to avoid in the first place. Introducing a priority would probably be even messier.
Posts: 19
Joined: Oct 2012
Reputation:
3
OK, I've just changed the parameter syntax from capitalized attributes (PosX="120") to a namespace prefix (param:posx="120").
Posts: 19
Joined: Oct 2012
Reputation:
3
2014-07-27, 22:28
(This post was last modified: 2014-07-31, 16:36 by rahotep.)
Yes, the default value is not used because you're explicitly overriding it with something that resolves to an empty string. This is by the current design. Since posx parameter has not been passed to MyControl nor there is a default value defined for it in MyControl, "$PARAM[posx]" gets expanded to "" and behaves as if you'd explicitly written <include param:posx="">MyControlVars</include>, which does override the default value in MyControlVars.
I think we could implement what you proposed by adding a special case for passing parameter values of the form "$PARAM[name]" to the nested include (with no extra characters around), where 'name' refers to an undefined parameter, so that the default value from the nested include is used instead.
Thanks for the suggestion.
Posts: 19
Joined: Oct 2012
Reputation:
3
2014-07-30, 18:12
(This post was last modified: 2014-07-31, 19:48 by rahotep.)
After giving it some more thought, I edited my previous post to make it more clear and deleted the unnecessary follow-up.
Posts: 222
Joined: Apr 2014
Reputation:
78
bkury
Senior Member
Posts: 222
Ah I see, must have missed that part ... thank you!
Posts: 247
Joined: Oct 2011
Reputation:
11
in which version will this be available in?
Posts: 247
Joined: Oct 2011
Reputation:
11
Do we have a wiki page or other documentation on how this new feature works?