See https://www.mediawiki.org/wiki/Extension_talk:Variables/Archive#Default_values_for_vardefine_and_vardefineecho. Basically, instead of requiring {{ #vardefine: var1 | {{ #if: {{{param1|}}} | {{{param1}}} | something else }} }}, it should be possible to just do {{ #vardefine: var1 | {{{param1|}}} | something else }}. Multiple values might be useful, though there were concerns raised in the linked discussion that they might complicate the code too much, in which case just a single value would be fine.
Description
Related Objects
- Mentioned Here
- T201878: Add `#or:` parser function
Event Timeline
While this could be easily done, I agree with @Danwe that it adds some complexity that would probably be better suited in a seperate #or: parser function. Such a parser function sounds quite interesting, but is unlikely to be included in ParserFunctions (we can try though) as well as out of scope for Variables. However, I think that the behavior you suggest is quite what I would suspect from a function like that. I'm kind of unsure if we should do this, however I would like to hear about further opinions.
It's worth noting that #var already provides a fallback/default value; in that vein, there is a certain (though probably pretty weak) argument for also providing one on #vardefine and #vardefineecho. This wouldn't preclude the creation of a separate #or parser function, though; instead, only a single fallback could be provided for these functions, and for more complicated cases, #or would allow multiple fallback values. (Of course, once you've got #or, strictly speaking there isn't a need for any fallbacks on #vardefine/#vardefineecho...)