Template:Always substitute: Difference between revisions
Appearance
imported>Oshwah m Added update to allow 'can' to be 'yesnomaybe' and to stabilize parameter input. The switch now lower-cases 'yesnomaybe' when comparing. |
imported>Oshwah m Dummy Edit: Accidentally pressed 'Enter' while typing edit summary. The last statement should've said, "the boolean conditions for 'auto' and 'nocat' now consistently default to "no" when set to a non-true string. |
||
| Line 1: | Line 1: | ||
{{{{{|safesubst:}}}#invoke:Unsubst|main|$B= | {{{{{|safesubst:}}}#invoke:Unsubst|main|$B= | ||
{{Ombox | {{Ombox | ||
| style = text-align: center; | | style = text-align: center; | ||
| name = Subst only | | name = Subst only | ||
| type = notice | | type = notice | ||
| text = This template <strong>{{#switch:{{lc:{{{yesnomaybe|}}}}}|can|may={{lc:{{{yesnomaybe}}}}} be [[Help:Substitution|substituted]]</strong> by using <!-- | | text = This template <strong>{{#switch:{{lc:{{{yesnomaybe|}}}}}|can|may={{lc:{{{yesnomaybe}}}}} be [[Help:Substitution|substituted]]</strong> by using <!-- | ||
--><strong>{{{actualtemplate|{{template other|{{Tls|{{#switch:{{SUBPAGENAME}}|doc|sandbox={{BASEPAGENAME}}|#default={{PAGENAME}}}}}}|{{Tlsu|{{FULLPAGENAME}}}}}}}}}</strong>|never=should <em> | --><strong>{{{actualtemplate|{{template other|{{Tls|{{#switch:{{SUBPAGENAME}}|doc|sandbox={{BASEPAGENAME}}|#default={{PAGENAME}}}}}}|{{Tlsu|{{FULLPAGENAME}}}}}}}}}</strong><!-- | ||
--><strong>{{{actualtemplate|{{template other|{{Tl|{{#switch:{{SUBPAGENAME}}|doc|sandbox={{BASEPAGENAME}}|#default={{PAGENAME}}}}}}|{{ | -->|not|never=should <em>{{lc:{{{yesnomaybe}}}}}</em> be [[Help:Substitution|substituted]]</strong> – use <!-- | ||
--><strong>{{{actualtemplate|{{template other|{{Tls|{{#switch:{{SUBPAGENAME}}|doc|sandbox={{BASEPAGENAME}}|#default={{PAGENAME}}}}}}|{{Tlsu|{{FULLPAGENAME}}}}}}}}}</strong>}}. <!-- | --><strong>{{{actualtemplate|{{template other|{{Tl|{{#switch:{{SUBPAGENAME}}|doc|sandbox={{BASEPAGENAME}}|#default={{PAGENAME}}}}}}|{{Tlu|{{FULLPAGENAME}}}}}}}}}</strong><!-- | ||
-->{{# | -->|#default=should <em>always</em> be [[Help:Substitution|substituted]]</strong> – use <!-- | ||
-->{{#if:{{{alt|}}}|{{#ifeq:{{{auto|}}}|yes|<br/>}}For [[Help:Transclusion|transclusion]], use <strong>{{#ifeq:{{NAMESPACE:{{{alt}}}}}|Template|{{ | --><strong>{{{actualtemplate|{{template other|{{Tls|{{#switch:{{SUBPAGENAME}}|doc|sandbox={{BASEPAGENAME}}|#default=<includeonly>{{PAGENAME}}</includeonly><noinclude>Example</noinclude>}}}}|{{Tlsu|{{FULLPAGENAME}}}}}}}}}</strong>}}. <!-- | ||
}}{{# | -->{{#ifeq:{{yesno-no|{{{auto|}}}}}|yes|{{#switch:{{lc:{{{yesnomaybe|}}}}}|can|may|not|never=|#default=Any accidental transclusions will be automatically substituted by a bot.{{{1|}}}{{#ifeq:{{yesno-no|{{{nocat|<noinclude>true</noinclude>}}}}}|yes|<!--no categorization-->|{{#switch:{{SUBPAGENAME}}|doc|sandbox=|#default=[[Category:Wikipedia templates to be automatically substituted]]}}}}}}}} <!-- | ||
|never=[[Category:Wikipedia never-substituted templates]] | |||
|may=<!--No applicable category--> | -->{{#if:{{{alt|}}}|{{#switch:{{lc:{{{yesnomaybe|}}}}}|can|may|not|never=|#default={{#ifeq:{{{auto|}}}|yes|<br/>}}For [[Help:Transclusion|transclusion]], use <strong>{{#ifeq:{{NAMESPACE:{{{alt}}}}}|Template|{{[[{{{alt}}}|{{PAGENAME:{{{alt}}}}}]]}}|{{Tlg|{{{alt}}}}}}}</strong> instead.}}}} | ||
|#default=[[Category:Wikipedia substituted templates]]{{#ifexpr: 0{{Find page text |text=<!%-%- *{{NAMESPACE}}:[{{lc:{{str left|{{Lua escape|{{{1|{{PAGENAME}}}}}}}|1}}}}{{uc:{{str left|{{Lua escape|{{{1|{{PAGENAME}}}}}}}|1}}}}]{{str right|{{Lua escape|{{{1|{{PAGENAME}}}}}}}|1}} *%-%-> |title={{FULLPAGENAME}} |plain=f}} > 0 | [[Category:Templates with matching hidden id]]}} | }}{{#ifeq:{{yesno-no|{{{nocat|<noinclude>true</noinclude>}}}}}|yes|<!--no categorization-->|{{#switch:{{SUBPAGENAME}}|doc|sandbox=|#default={{#switch:{{lc:{{{yesnomaybe|}}}}} | ||
}}}}}}}}<includeonly>__EXPECTUNUSEDTEMPLATE__</includeonly><noinclude>{{Documentation}}</noinclude> | |not|never=[[Category:Wikipedia never-substituted templates]] | ||
|can|may=<!--No applicable category--> | |||
|#default=[[Category:Wikipedia substituted templates]]{{#ifexpr: 0{{Find page text |text=<!%-%- *{{NAMESPACE}}:[{{lc:{{str left|{{Lua escape|{{{1|{{PAGENAME}}}}}}}|1}}}}{{uc:{{str left|{{Lua escape|{{{1|{{PAGENAME}}}}}}}|1}}}}]{{str right|{{Lua escape|{{{1|{{PAGENAME}}}}}}}|1}} *%-%-> |title={{FULLPAGENAME}} |plain=f}} > 0 | [[Category:Templates with matching hidden id]]}} | |||
}}}}}}}}<includeonly>__EXPECTUNUSEDTEMPLATE__</includeonly><noinclude> | |||
{{Documentation}} | |||
</noinclude> | |||
Latest revision as of 09:25, 13 August 2026
| File:Information icon4.svg | This template should always be substituted – use Template:Tls. |
File:Test Template Info-Icon - Version (2).svg Template documentationcreatepurge