Difference between revisions of "User:Ericb/Sandbox"
From MHWiki
(more experiments - ifeq works) |
m (check for stray spacing) |
||
Line 6: | Line 6: | ||
What happens if I use a template: | What happens if I use a template: | ||
− | *with no argument: {{User:Ericb/Use}} | + | *with no argument: -{{User:Ericb/Use}}- |
− | *with no named argument: {{User:Ericb/Use|discard}} | + | *with no named argument: -{{User:Ericb/Use|discard}}- |
− | *with named argument empty: {{User:Ericb/Use|use=}} | + | *with named argument empty: -{{User:Ericb/Use|use=}}- |
− | *with named argument first: {{User:Ericb/Use|use=hello|discard}} | + | *with named argument first: -{{User:Ericb/Use|use=hello|discard}}- |
− | *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}}- |
− | *with different named arg: {{User:Ericb/Use|other=hello}} | + | *with different named arg: -{{User:Ericb/Use|other=hello}}- |
− | *with two names: {{User:Ericb/Use|use me=now}} | + | *with two names: -{{User:Ericb/Use|use me=now}}- |
− | *with indirection: {{User:Ericb/Use|indir=name|name=hello}} | + | *with indirection: -{{User:Ericb/Use|indir=name|name=hello}}- |
− | *with indirection, swapped order: {{User:Ericb/Use|name=hello|indir=name}} | + | *with indirection, swapped order: -{{User:Ericb/Use|name=hello|indir=name}}- |
− | *indirection without name: {{User:Ericb/Use|indir=name}} | + | *indirection without name: -{{User:Ericb/Use|indir=name}}- |
− | *indirection with empty name: {{User:Ericb/Use|indir=name|name=}} | + | *indirection with empty name: -{{User:Ericb/Use|indir=name|name=}}- |
Experiments with If: | Experiments with If: | ||
− | *no args: {{User:Ericb/If}} | + | *no args: -{{User:Ericb/If}}- |
− | *1 empty arg: {{User:Ericb/If|}} | + | *1 empty arg: -{{User:Ericb/If|}}- |
− | *1 non-empty arg: {{User:Ericb/If|text}} | + | *1 non-empty arg: -{{User:Ericb/If|text}}- |
− | *2 args, first empty: {{User:Ericb/If||true}} | + | *2 args, first empty: -{{User:Ericb/If||true}}- |
− | *2 args, first text: {{User:Ericb/If|text|true}} | + | *2 args, first text: -{{User:Ericb/If|text|true}}- |
− | *3 args, first empty: {{User:Ericb/If||true|false}} | + | *3 args, first empty: -{{User:Ericb/If||true|false}}- |
− | *3 args, first text: {{User:Ericb/If|text|true|false}} | + | *3 args, first text: -{{User:Ericb/If|text|true|false}}- |
Experiments with Ifeq: | Experiments with Ifeq: | ||
− | *no args: {{User:Ericb/Ifeq}} | + | *no args: -{{User:Ericb/Ifeq}}- |
− | *2 args, equal: {{User:Ericb/Ifeq|test|test}} | + | *2 args, equal: -{{User:Ericb/Ifeq|test|test}}- |
− | *2 args, differ: {{User:Ericb/Ifeq|test|test1}} | + | *2 args, differ: -{{User:Ericb/Ifeq|test|test1}}- |
− | *4 args, equal: {{User:Ericb/Ifeq|test|test|hello|discard}} | + | *4 args, equal: -{{User:Ericb/Ifeq|test|test|hello|discard}}- |
− | *4 args, differ: {{User:Ericb/Ifeq|test|test1|discard|hello}} | + | *4 args, differ: -{{User:Ericb/Ifeq|test|test1|discard|hello}}- |
Revision as of 12:10, 25 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-
- with different named arg: --
- with two names: --
- with indirection: -hello-
- with indirection, swapped order: -hello-
- indirection without name: --
- indirection with empty name: --
Experiments with If:
- 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-
Experiments with Ifeq:
- no args: --
- 2 args, equal: --
- 2 args, differ: --
- 4 args, equal: -hello-
- 4 args, differ: -hello-