I'm working with a wiki template that sets a property using "#set":
{{#set:Is foo=Y}}
Is there a way to access the value of that property within the template or within a document using that template? I've tried {{{Is foo}}}
, but that only works with document params. The broader context is that I need to ensure that documents currently missing that property have a default applied, along the lines of:
{{#if:{{{Is foo|}}}{{{Is foo|}}}|{{#set:Is foo=N}}
Documentation: :Setting_values
I'm working with a wiki template that sets a property using "#set":
{{#set:Is foo=Y}}
Is there a way to access the value of that property within the template or within a document using that template? I've tried {{{Is foo}}}
, but that only works with document params. The broader context is that I need to ensure that documents currently missing that property have a default applied, along the lines of:
{{#if:{{{Is foo|}}}{{{Is foo|}}}|{{#set:Is foo=N}}
Documentation: https://www.semantic-mediawiki.org/wiki/Help:Setting_values
Share Improve this question asked Jan 18 at 17:25 MothOnMarsMothOnMars 2,3693 gold badges22 silver badges24 bronze badges1 Answer
Reset to default 0I think wha you want is a template {{Some template}}
defined thus:
{{#set:Is foo={{{foo|default value for Is foo}}}}}
The template is called like this: {{Some template|foo=Non-default value for Is foo}}
or {{Some template}}
(will set the default value).