Шаблон:IfCommons

Материал из Department of Theoretical and Applied Mechanics
Версия от 21:11, 15 сентября 2013; Fabartus (обсуждение) (genesis - preliminary)

(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск
The purpose of this category switching template is to select different categories
... is to pre-select appropriate commons categories for an image that is 'being approved by a human' for the BOT to move.
  • It works by using a parserFunction test of the website, one group of categories can be enabled and another disabled AFTER the move using the template,
  • conversely, the second group is enabled and appropriate on Wikipedia BEFORE the Move. (So shows above as the parameter 'Wikipedia')
Template logic
{{#ifeq:{{SITENAME}}|Wikipedia
|<!-- Wikipedia Categories--->
{{{Wikipedia|{{{2|}}}}}}
{{{4|}}}
|<!--- ELSE IsCommons=No, so these listed must be active on the Commons
--->
{{{Commons|{{{1|}}}}}}
{{{3|}}}
}}

As should be readily understood, the template is hung and the categories to be active on the commons (redlinks on en.wikipedia) can be listed after the first pipe '|' character.

Example used
{{IfCommons
|<!-- then {{{1}}} is listed commons only categories / templates --->
[[Category:Lehigh Valley]]
[[Category:Anthracite mining in Pennsylvania]] 
[[Category:Coal Company]] 
[[Category:Mining images of Pennsylvania]]

|<!-- ELSE here put list of Wikipedia only categories / templates --->

[[Category:Fairuse images of Anthracite mining company screenshots]]

}}