Difference between revisions of "User:Ericb/Sandbox"

From MHWiki
(experiment with template, in sandbox this time)
(more experiments)
Line 12: Line 12:
 
*with named argument second: {{User:Ericb/Use|discard|use=hello}}
 
*with named argument second: {{User:Ericb/Use|discard|use=hello}}
 
*with named argument twice: {{User:Ericb/Use|use=first|use=second}}
 
*with named argument twice: {{User:Ericb/Use|use=first|use=second}}
 +
 +
Putting those pieces together:
 +
*no args: {{User:Ericb/If}}
 +
*1 empty arg: {{User:Ericb/If|}}
 +
*1 non-empty arg: {{User:Ericb/If|text}}
 +
*2 args, first empty: {{User:Ericb/If||true}}
 +
*2 args, first text: {{User:Ericb/If|text|true}}
 +
*3 args, first empty: {{User:Ericb/If||true|false}}
 +
*3 args, first text: {{User:Ericb/If|text|true|false}}

Revision as of 03:49, 24 October 2011

Next project(s):

  • is it possible to add optional subgroup to Template:Mouse?
  • what else needs doing?

It looks like this wiki lacks Extension:ParserFunctions, which means no {{#if:test|if text|if empty}}. But I think I can work around it with my own template, using double template nesting. To test that...

What happens if I use a template:

  • with no argument:
  • with no named argument:
  • with named argument empty:
  • with named argument first: hello
  • with named argument second: hello
  • with named argument twice: second

Putting those pieces together:

  • no args:
  • 1 empty arg:
  • 1 non-empty arg:
  • 2 args, first empty:
  • 2 args, first text: true
  • 3 args, first empty: false
  • 3 args, first text: true