I have a MediaWiki template that I want to use in other templates, but I want the first template to add <onlyinclude>
tags to the other templates it gets used in.
Unfortunately these tags get processed on the first template, so they ever get included in the target template.
How can this be done?
Example:
- TemplateA:
content is <onlyinclude>{{{1}}}</onlyinclude>
- Article1:
Article 1 {{TemplateA|Hello}}
- Article2:
Article 2 can say {{:Article1}}
I would like this to appear as:
- Article1:
Article 1 content is Hello
- Article2:
Article 2 can say Hello
The problem is the <onlyinclude>
tags get processed on TemplateA
whereas I want them to get passed through to Article1
and processed on Article1
instead.
<onlyinclude>
tags appear automatically, without editors having to remember to include them every time they add an infobox to a page.