Difference between revisions of "Template:Commoncats"

From blackwiki
Jump to navigation Jump to search
imported>Fabartus
(fmt odd case, try inserting a <div> start and replace </div> taken out a while back)
imported>Fabartus
m (refactor problem put the end div (</div>) back. This edit to version two back.)
Line 22: Line 22:
  
 
<!----------------------------------- Logo images ----------------------------------->
 
<!----------------------------------- Logo images ----------------------------------->
<!--start_div2/+DV02:--><!--
+
<!--start_div2/+DV02:--><div style="float:left; border:1px solid #a9a9a9;"><!--
--><div style="float:left; border:1px solid #a9a9a9;"><!--
+
  -->{{#ifeq:Wikimedia Commons |<!--equals:-->{{SITENAME}} <!--
  -->{{#ifeq:Wikimedia Commons|{{SITENAME}} <!----then:
+
-->|<!--then:-->[[Image:Wikipedia-logo.png|left|{{#if:{{{boxwidth|{{{width|}}}}}}|13px|30px}}|none]]<!--Image:Wikipedia-logo.png
+++ -->|<!--
 
+++ -->[[Image:Wikipedia-logo.png|left|<!--
 
+++ -->{{#if:{{{boxwidth|}}}{{{width|}}}|13px|30px}}<!--
 
+++ -->|none]]<!--END of [Image:Wikipedia-logo.png] insertion...
 
+++
 
 
  === -->{{#if: {{{2A|}}}{{{3A|}}}{{{2C|}}}{{{3C|}}}<!--
 
  === -->{{#if: {{{2A|}}}{{{3A|}}}{{{2C|}}}{{{3C|}}}<!--
 
  === === -->|<br/><!-- Then: Add extra height between logos
 
  === === -->|<br/><!-- Then: Add extra height between logos
Line 36: Line 31:
 
               -->[[Image:Wikimedia_Foundation_RGB_logo_with_text.svg|{{#if:{{{boxwidth|{{{width|}}}}}}|13px|30px}}|left|none]] <!--
 
               -->[[Image:Wikimedia_Foundation_RGB_logo_with_text.svg|{{#if:{{{boxwidth|{{{width|}}}}}}|13px|30px}}|left|none]] <!--
 
  === --------------------------------------------------------------------- Else...
 
  === --------------------------------------------------------------------- Else...
  -->|<!--else:-->[[Image:Wikimedia_Foundation_RGB_logo_with_text.svg<!--
+
  -->|<!--else:-->[[Image:Wikimedia_Foundation_RGB_logo_with_text.svg|{{#if:{{{boxwidth|{{{width|}}}}}}|13px|30px}}|left|none]] <!--
+++ -->|{{#if:{{{boxwidth|{{{width|}}}}}}|13px|30px}}<!--
 
+++ -->|left|none]] <!--
 
 
  === -->{{#if: {{{2A|}}}{{{3A|}}}{{{2C|}}}{{{3C|}}}<!--
 
  === -->{{#if: {{{2A|}}}{{{3A|}}}{{{2C|}}}{{{3C|}}}<!--
 
  === === -->|<br/><!-- Then: Add extra height between logos
 
  === === -->|<br/><!-- Then: Add extra height between logos
Line 59: Line 52:
 
  === -->| $<!--
 
  === -->| $<!--
 
  === -->=<!--  
 
  === -->=<!--  
       
+
=== -->{{#switch: {{{1|}}} <!--  
case: {{{2}}} is one of {the set: '!', '#', or '$'}
+
combined logic of en.wp's CommonscatNo and commons:template:WikiPcatNo templates.
       
+
=== === -->| !<!-- switch 1-#2 tests
        === -->{{#switch: {{{1|}}} <!--  
+
=== === -->| #<!--  
        combined logic of en.wp's CommonscatNo and commons:template:WikiPcatNo templates.
+
=== === -->| $ =<!-- Detect skip Cat mode in Sw2-1 && Sw1-1... <br>
        === === -->| !<!-- switch 1-#2 tests
+
=== ...  
        === === -->| #<!--  
+
=== ... CASE: Both {{{1}}} and {{{2}}} are defined as '!', '#', or '$', thereby
        === === -->| $ =<!-- Detect skip Cat mode in Sw2-1 && Sw1-1... <br>
+
=== ... disabling default {{PAGENAME}} output, and putting all article linking logic here  
        === ...  
+
=== ...  
        === ... CASE: Both {{{1}}} and {{{2}}} are defined as '!', '#', or '$', thereby
+
=== === ...  Begin by seeing if there is an article override: (In Sw1-#1)
        === ... disabling default {{PAGENAME}} output, and putting all article linking logic here  
+
=== === -->{{#if: {{{1A|}}}{{{2A|}}}{{{3A|}}}<!-- OR (any articles =?= TRUE?) test (1)
        === ...  
+
=== === -->|<small><!-- OL-01 <!-- USE/need: rare to very-rare
        === === ...  Begin by seeing if there is an article override: (In Sw1-#1)
+
=== === === -->{{#if: {{{2A|}}}{{{3A|}}}<!--
        === === -->{{#if: {{{1A|}}}{{{2A|}}}{{{3A|}}}<!-- OR (any articles =?= TRUE?) test (1)
+
=== === === === -->|Likely articles on En.Wikipedia are:<!--
        === === -->|<small><!-- OL-01 <!-- USE/need: rare to very-rare
+
=== === === === -->|A likely article on En.Wikipedia is:<!--
        === === === -->{{#if: {{{2A|}}}{{{3A|}}}<!--
+
=== === === -->}}<!-- endif
        === === === === -->|Likely articles on En.Wikipedia are:<!--
+
=== === === === Do first output line, then test if there may be another...
        === === === === -->|A likely article on En.Wikipedia is:<!--
+
=== === === --></small><br /><b><!--{{S|3}}-->''[[{{WPD|}}{{{1A|{{PAGENAME}}}}}|{{{1A|{{PAGENAME}} }}}]]'' <!--
        === === === -->}}<!-- endif
+
=== === === -->{{#if: {{{2A|}}}{{{3A|}}} |<!--
        === === === === Do first output line, then test if there may be another...
+
=== === === === -->{{#if: {{{2A|}}} |or <br />''[[{{WPD|}}{{{2A}}} |{{{2A}}} ]]''}} <!--
        === === === --></small><br /><b><!--{{S|3}}-->''[[{{WPD|}}{{{1A|{{PAGENAME}}}}}|{{{1A|{{PAGENAME}} }}}]]'' <!--
+
=== === === === -->{{#if: {{{3A|}}} |or <br />''[[{{WPD|}}{{{3A}}} |{{{3A}}} ]]''}} <!--
        === === === -->{{#if: {{{2A|}}}{{{3A|}}} |<!--
+
=== === === -->}}<!-- endif (another)
        === === === === -->{{#if: {{{2A|}}} |or <br />''[[{{WPD|}}{{{2A}}} |{{{2A}}} ]]''}} <!--
+
=== === -->|<small><!-- OL-02 (No English Wikipedia article)</small><br><!-- USE/need: med-rare to rare
        === === === === -->{{#if: {{{3A|}}} |or <br />''[[{{WPD|}}{{{3A}}} |{{{3A}}} ]]''}} <!--
+
=== === -->}}<!--endif (any articles =?= TRUE?) test
        === === === -->}}<!-- endif (another)
+
=== === ===   
        === === -->|<small><!-- OL-02 (No English Wikipedia article)</small><br><!-- USE/need: med-rare to rare
+
=== === ===  Regardless of other output, this switch case combination categorises to:
        === === -->}}<!--endif (any articles =?= TRUE?) test
+
=== -->[[Category:Sister Project category scheme mismatch]] <!--
        === === ===   
+
===  
        === === ===  Regardless of other output, this switch case combination categorizes to:
+
=== Endcase: Sw(1) says one of '!', '#', or '$' is TRUE, as is Sw(2) case
        === -->[[Category:Sister Project category scheme mismatch]] <!--
+
===  
        ===  
+
=== -->}}<!-- End switch (1-#1)
        === Endcase: Sw(1) says one of '!', '#', or '$' is TRUE, as is Sw(2) case
+
===
        ===  
+
============================
        === -->}}<!-- End switch (1-#1)
+
=== Back in Switch (2-#1) ==
        ===
+
============================
        ============================
+
  === -->| #default =<!-- p/o Switch (2-#1)... reaching HERE means: 'no command character'  
        === Back in Switch (2-#1) ==
+
  === ... detected as parameter {{{2}}}. {{{2}}} is null, or {{{2}}} has a pagename that
        ============================
+
  === ... is other than the default category. (Or is a garbage character or word!)
       
 
  === -->| #default =<!-- p/o Switch (2-#1)...
 
       
 
============================================================================================
 
case: reaching HERE means: 'no command meta-character in {{{2}}}'  
 
       
 
       
 
  === ... no escape character detected as parameter {{{2}}}. {{{2}}} is null, or {{{2}}} has a pagename that
 
  === ... is other than the default category. (Or is a garbage character or word! <g>)
 
=============================================================================================
 
 
  === Begin switch 1-#2...
 
  === Begin switch 1-#2...
  === -->{{#if:{{{1|}}}|<div>}}<!--
+
  === -->{{#switch: {{{1}}}<!--  
       
 
    -->{{#switch: {{{1}}}<!--  
 
 
  === === -->| !<!-- switch 1-#2 tests
 
  === === -->| !<!-- switch 1-#2 tests
 
  === === -->| #<!--  
 
  === === -->| #<!--  
Line 319: Line 300:
 
  ---   
 
  ---   
 
---->{{Left60|BG=#def|98|B=1|M=0}}
 
---->{{Left60|BG=#def|98|B=1|M=0}}
 +
{{Commoncats|!|Objects}}
 
;Purpose
 
;Purpose
 
:Template:Commoncats replaces a large number of templates formerly used to link between category pages between the English Wikipedia and the multilingual environment of {{wpd|Wikimedia Commons}} ("The Commons").
 
:Template:Commoncats replaces a large number of templates formerly used to link between category pages between the English Wikipedia and the multilingual environment of {{wpd|Wikimedia Commons}} ("The Commons").
 
# Unlike it's rivals (sic) it usually replaces multiple templates ('''{{tl|Catmore}} ''and'' {{tl|Commons cat}}''', or other variant of 'commons cat'), can link to multiple commons categories, and displays the main article for the en.wikipedia category... usually without anything but the template name: <code><nowiki>{{Commoncats}}</nowiki></code>.
 
# Unlike it's rivals (sic) it usually replaces multiple templates ('''{{tl|Catmore}} ''and'' {{tl|Commons cat}}''', or other variant of 'commons cat'), can link to multiple commons categories, and displays the main article for the en.wikipedia category... usually without anything but the template name: <code><nowiki>{{Commoncats}}</nowiki></code>.
##The exception is those '''main articles''' where by the naming conventions the article is singular case, and the main category is plural. {{i}}{{Bull}}These are <code>handled identically to {{tl|catmore}}</code>, which is to say {{i}}{{Bull}}by specifying the article name as the first argument (the numbered parameter <code> <tt><nowiki>{{{1}}}</nowiki> </code> {{i}}{{Bull}}or the (named parameter) argument <code>'1A='</tt> ''something''</code> {{i}}{{Bull}}two other named parameters arguments <code>'|2A= ''something-2'' ' & '|3A= ''something-3'' '</tt> </code> ''can be specified'' to link upto three related article pages. (Say a list article, and two related topics sharing the category){{Commonscats|!|Objects}}
+
##The exception is those '''main articles''' where by the naming conventions the article is singular case, and the main category is plural. {{i}}{{Bull}}These are <code>handled identically to {{tl|catmore}}</code>, which is to say {{i}}{{Bull}}by specifying the article name as the first argument (the numbered parameter <code> <tt><nowiki>{{{1}}}</nowiki> </code> {{i}}{{Bull}}or the (named parameter) argument <code>'1A='</tt> ''something''</code> {{i}}{{Bull}}two other named parameters arguments <code>'|2A= ''something-2'' ' & '|3A= ''something-3'' '</tt> </code> ''can be specified'' to link upto three related article pages. (Say a list article, and two related topics sharing the category)
 
## Unlike requiring a ''''explict link name''' call form'' such as {{tl2|Commons cat|Teaching illustrations}}, in all the foregoing, the template was also linking to the commons category of the same category name like some of the earlier templates it replaces that also linked to both types of pages.  {{i}}{{Bull}}To use in the small percentage of case where there is no appropriate main article for a category, {{Tlx|Commoncats|!}} will replicate the ''only-the-category-linking' of {{tl2|Commons cat|<nowiki>{{PAGENAME}}</nowiki>}}... again, without needing to specify the page name (See magic word: [[M:Help:Magic words|<nowiki>{{PAGENAME}}</nowiki>]])
 
## Unlike requiring a ''''explict link name''' call form'' such as {{tl2|Commons cat|Teaching illustrations}}, in all the foregoing, the template was also linking to the commons category of the same category name like some of the earlier templates it replaces that also linked to both types of pages.  {{i}}{{Bull}}To use in the small percentage of case where there is no appropriate main article for a category, {{Tlx|Commoncats|!}} will replicate the ''only-the-category-linking' of {{tl2|Commons cat|<nowiki>{{PAGENAME}}</nowiki>}}... again, without needing to specify the page name (See magic word: [[M:Help:Magic words|<nowiki>{{PAGENAME}}</nowiki>]])
 
## Like {{Tl|Commons cat}}, you can also indeed specify an entirely different commons page name:{{I}}"{{tlx|Commoncats|!|Objects}}" (shown above and right)
 
## Like {{Tl|Commons cat}}, you can also indeed specify an entirely different commons page name:{{I}}"{{tlx|Commoncats|!|Objects}}" (shown above and right)

Revision as of 02:55, 31 July 2008

English Wikipedia article:
[[Template:WPDCommoncats |Commoncats ]]


Commons related category:
[[:Template:OTHERSITECategory:Commoncats | Commoncats ]]


Template:Left60


Commons related category:
[[:Template:OTHERSITECategory:Objects| Objects]]
Purpose
Template:Commoncats replaces a large number of templates formerly used to link between category pages between the English Wikipedia and the multilingual environment of Template:Wpd ("The Commons").
  1. Unlike it's rivals (sic) it usually replaces multiple templates ({{Catmore}} and {{Commons cat}}, or other variant of 'commons cat'), can link to multiple commons categories, and displays the main article for the en.wikipedia category... usually without anything but the template name: {{Commoncats}}.
    1. The exception is those main articles where by the naming conventions the article is singular case, and the main category is plural.
  2. REDIRECT Template:•
  • Fully protected: This is a redirect from a title that is fully protected from editing for any of several possible reasons. It may have been protected by an administrator, or it may be on the Cascade-protected list, or both.
    • Please do not replace these redirected links with links directly to the target page unless expressly advised to do so below or elsewhere on this page, or if the change is supported by a policy or guideline.

These are handled identically to {{catmore}}, which is to say

  1. REDIRECT Template:•
  • Fully protected: This is a redirect from a title that is fully protected from editing for any of several possible reasons. It may have been protected by an administrator, or it may be on the Cascade-protected list, or both.
    • Please do not replace these redirected links with links directly to the target page unless expressly advised to do so below or elsewhere on this page, or if the change is supported by a policy or guideline.

by specifying the article name as the first argument (the numbered parameter {{{1}}}

  1. REDIRECT Template:•
  • Fully protected: This is a redirect from a title that is fully protected from editing for any of several possible reasons. It may have been protected by an administrator, or it may be on the Cascade-protected list, or both.
    • Please do not replace these redirected links with links directly to the target page unless expressly advised to do so below or elsewhere on this page, or if the change is supported by a policy or guideline.

or the (named parameter) argument '1A=' something

  1. REDIRECT Template:•
  • Fully protected: This is a redirect from a title that is fully protected from editing for any of several possible reasons. It may have been protected by an administrator, or it may be on the Cascade-protected list, or both.
    • Please do not replace these redirected links with links directly to the target page unless expressly advised to do so below or elsewhere on this page, or if the change is supported by a policy or guideline.

two other named parameters arguments '|2A= something-2 ' & '|3A= something-3 ' can be specified to link upto three related article pages. (Say a list article, and two related topics sharing the category)

    1. Unlike requiring a 'explict link name call form such as {{Commons cat|Teaching illustrations}}, in all the foregoing, the template was also linking to the commons category of the same category name like some of the earlier templates it replaces that also linked to both types of pages.
  1. REDIRECT Template:•
  • Fully protected: This is a redirect from a title that is fully protected from editing for any of several possible reasons. It may have been protected by an administrator, or it may be on the Cascade-protected list, or both.
    • Please do not replace these redirected links with links directly to the target page unless expressly advised to do so below or elsewhere on this page, or if the change is supported by a policy or guideline.

To use in the small percentage of case where there is no appropriate main article for a category, {{Commoncats|!}} will replicate the only-the-category-linking' of {{Commons cat|{{PAGENAME}}}}... again, without needing to specify the page name (See magic word: {{PAGENAME}})

    1. Like {{Commons cat}}, you can also indeed specify an entirely different commons page name:
      "{{Commoncats|!|Objects}}" (shown above and right)
further modes
  • The Command meta characters ('!', '$', or '#') are used as placeholders in either or both {{Commoncats|{{{1}}}|{{{2}}} }} for
    Skipping a category or article link in place of the default {{PAGENAME}}.
  • The Command meta characters ('@', '"', or ' ') are used as placeholders in either or both {{Commoncats|{{{1}}}|{{{2}}} }} for explicitly directing a category or article link be made with the default {{PAGENAME}}.

For further usage, see: Template:WpdTemplate:Left60