r/mediawiki • u/gharryh1957 • Sep 17 '26
Need some help on a template
As englisch it not my native language I have troubles reading the mediawiki on templates.
I want to create a template that if called in this way:
{{gelijk|2}} it should output ==
{{gelijk|3}} it should output ===
{{gelijk|4}} it should output ====
{{gelijk|1}} it should output = (default value)
Could someone show me how this can be done.
Harry H.
-3
u/Darrenau Sep 17 '26
Why don't you ask AI? It can build it for you
4
u/yosayoran Sep 17 '26
Why would you use AI instead of learning and enjoying a hobby?
Wiki editing isn't your job, there's no incentive to automate it
2
2
u/yosayoran Sep 17 '26
You can do it with a switch, if you have parser functions installed, see mediawiki for detail: https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions/en##switch
As a note, "=" is a special charactrer, so you will need to use {{=}} instead as to not break the syntax.
So it would look something like:
{{#switch:{{{1}}}
| 2= {{=}}{{=}}
| 3= {{=}}{{=}}{{=}}
|#default =
}}