|
|
Line 1: |
Line 1: |
| + | It looks like this wiki lacks Extension:ParserFunctions, which means no <nowiki>{{#if:test|if text|if empty}}</nowiki>. But I managed to work around that with my [[Template:If]], using double template nesting. |
| + | |
| Next project(s): | | Next project(s): |
− | * using my new conditional templates to add optional subgroup to [[Template:Mouse]] | + | * Finish linking to Larry's Loot Lexicon via [[Template:MHinfo]] - still to go: [[Crafting Items]], [[Special]], and [[Collectibles]]. |
− | * what else needs doing?
| |
− | | |
− | It looks like this wiki lacks Extension:ParserFunctions, which means no <nowiki>{{#if:test|if text|if empty}}</nowiki>. 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: -{{Use}}-
| |
− | *with no named argument: -{{Use|discard}}-
| |
− | *with named argument empty: -{{Use|use=}}-
| |
− | *with named argument first: -{{Use|use=hello|discard}}-
| |
− | *with named argument second: -{{use|discard|use=hello}}-
| |
− | *with named argument twice: -{{use|use=first|use=second}}-
| |
− | *with different named arg: -{{Use|other=hello}}-
| |
− | *with two names: -{{Use|use me=now}}-
| |
− | *with indirection: -{{Use|indir=name|name=hello}}-
| |
− | *with indirection, swapped order: -{{use|name=hello|indir=name}}-
| |
− | *indirection without name: -{{Use|indir=name}}-
| |
− | *indirection with empty name: -{{Use|indir=name|name=}}-
| |
− | | |
− | Experiments with If:
| |
− | *no args: -{{If}}-
| |
− | *1 empty arg: -{{If|}}-
| |
− | *1 non-empty arg: -{{If|text}}-
| |
− | *2 args, first empty: -{{If||true}}-
| |
− | *2 args, first text: -{{if|text|true}}-
| |
− | *3 args, first empty: -{{if||true|false}}-
| |
− | *3 args, first text: -{{If|text|true|false}}-
| |
− | | |
− | Experiments with Ifeq:
| |
− | *no args: -{{Ifeq}}-
| |
− | *2 args, equal: -{{Ifeq|test|test}}-
| |
− | *2 args, differ: -{{ifeq|test|test1}}-
| |
− | *4 args, equal: -{{ifeq|test|test|hello|discard}}-
| |
− | *4 args, differ: -{{Ifeq|test|test1|discard|hello}}-
| |
− | *4 args, both empty: -{{ifeq|||hello|discard}}-
| |
− | *4 args, both undefined: -{{Ifeq|3=hello|4=discard}}-
| |
− | *4 args, first empty: -{{Ifeq||test|discard|hello}}-
| |
− | *4 args, second undefined: -{{ifeq|test|3=discard|4=hello}}-
| |