I waited for an answer for awhile, then tried it anyway. No joy.
I created (at en:) the template {{emit category}}.
[[Category:{{{1}}}{{{{{subst|}}}#if:{{{2|}}}|{{{{{subst|}}}!}}{{{2}}}}}]]
The template ends with 1 newline, as usual.
BTW: this seems to require subst of {{!}} -- and that works, contrary to the
documentation. There's probably a way to do this without the second subst,
perhaps by duplicating the entire [[Category]] in both then and else clauses?
{{{{{subst|}}}#if:{{{par1|}}}
|{{{{{subst|}}}emit category|1={{{par1|}}}|2={{{key1|}}}|subst={{{subst|}}}}}
}}{{{{{subst|}}}#if:{{{par2|}}}
|{{{{{subst|}}}emit category|1={{{par2|}}}|2={{{key2|}}}|subst={{{subst|}}}}}
}}{{{{{subst|}}}#if:{{{par3|}}}
|{{{{{subst|}}}emit category|1={{{par3|}}}|2={{{key3|}}}|subst={{{subst|}}}}}
}}
Still yields 3 categories on the same line.
Why is the parser function sucking up the newlines in the meta template?
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l