Difference between revisions of "Template:H2G2/sandbox"

From blackwiki
Jump to navigation Jump to search
imported>HairyWombat
m (Put back {{template sandbox notice}})
imported>HairyWombat
(Added improved error processing)
Line 1: Line 1:
{{#ifeq:{{{link|}}}|yes|{{#switch: {{{1|}}}
+
{{#switch: {{{link|no}}}
| radio =
 
    {{#switch: {{{2}}}
 
    | 1 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the First|fit the first]]
 
    | 2 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Second|fit the second]]
 
    | 3 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Third|fit the third]]
 
    | 4 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Fourth|fit the fourth]]
 
    | 5 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Fifth|fit the fifth]]
 
    | 6 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Sixth|fit the sixth]]
 
    | 7 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Seventh|fit the seventh]]
 
    | 8 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Eighth|fit the eighth]]
 
    | 9 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Ninth|fit the ninth]]
 
    | 10 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Tenth|fit the tenth]]
 
    | 11 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Eleventh|fit the eleventh]]
 
    | 12 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Twelfth|fit the twelfth]]
 
    | 13 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Thirteenth|fit the thirteenth]]
 
    | 14 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Fourteenth|fit the fourteenth]]
 
    | 15 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Fifteenth|fit the fifteenth]]
 
    | 16 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Sixteenth|fit the sixteenth]]
 
    | 17 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Seventeenth|fit the seventeenth]]
 
    | 18 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Eighteenth|fit the eighteenth]]
 
    | 19 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Nineteenth|fit the nineteenth]]
 
    | 20 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Twentieth|fit the twentieth]]
 
    | 21 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Twenty-First|fit the twenty-first]]
 
    | 22 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Twenty-Second|fit the twenty-second]]
 
    | 23 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Twenty-Third|fit the twenty-third]]
 
    | 24 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Twenty-Fourth|fit the twenty-fourth]]
 
    | 25 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Twenty-Fifth|fit the twenty-fifth]]
 
    | 26 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Twenty-Sixth|fit the twenty-sixth]]
 
    | #default = <span style="color:red">Error in template H2G2,radio: Second parameter not recognised</span>
 
    }} of the radio series
 
  
| book =  
+
| yes = {{#switch: {{{1|}}}
    the novel {{#switch: {{{2}}}
+
    | radio = {{#switch: {{{2}}}
    | 1 = [[The Hitchhiker's Guide to the Galaxy (novel)|''The Hitchhiker's Guide to the Galaxy'']]
+
        | 1 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the First|fit the first]]
    | 2 = ''[[The Restaurant at the End of the Universe]]''
+
        | 2 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Second|fit the second]]
    | 3 = ''[[Life, the Universe and Everything]]''
+
        | 3 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Third|fit the third]]
    | 4 = ''[[So Long, and Thanks for All the Fish]]''
+
        | 4 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Fourth|fit the fourth]]
    | 5 = ''[[Mostly Harmless]]''
+
        | 5 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Fifth|fit the fifth]]
    | 6 = [[And Another Thing... (novel)|''And Another Thing...'']]
+
        | 6 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Sixth|fit the sixth]]
     | #default = <span style="color:red">Error in template H2G2,book: Second parameter not recognised</span>
+
        | 7 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Seventh|fit the seventh]]
     }}
+
        | 8 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Eighth|fit the eighth]]
 +
        | 9 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary    Phases#Fit the Ninth|fit the ninth]]
 +
        | 10 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Tenth|fit the tenth]]
 +
        | 11 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Eleventh|fit the eleventh]]
 +
        | 12 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#Fit the Twelfth|fit the twelfth]]
 +
        | 13 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Thirteenth|fit the thirteenth]]
 +
        | 14 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Fourteenth|fit the fourteenth]]
 +
        | 15 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Fifteenth|fit the fifteenth]]
 +
        | 16 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Sixteenth|fit the sixteenth]]
 +
        | 17 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Seventeenth|fit the seventeenth]]
 +
        | 18 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Eighteenth|fit the eighteenth]]
 +
        | 19 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Nineteenth|fit the nineteenth]]
 +
        | 20 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Twentieth|fit the twentieth]]
 +
        | 21 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Twenty-First|fit the twenty-first]]
 +
        | 22 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Twenty-Second|fit the twenty-second]]
 +
        | 23 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Twenty-Third|fit the twenty-third]]
 +
        | 24 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Twenty-Fourth|fit the twenty-fourth]]
 +
        | 25 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Twenty-Fifth|fit the twenty-fifth]]
 +
        | 26 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Twenty-Sixth|fit the twenty-sixth]]
 +
        | #default = <span style="color:red">Error in template H2G2,radio: Second parameter not recognised</span>
 +
        }} of the radio series
 +
 
 +
    | book =  
 +
        the novel {{#switch: {{{2}}}
 +
        | 1 = [[The Hitchhiker's Guide to the Galaxy (novel)|''The Hitchhiker's Guide to the Galaxy'']]
 +
        | 2 = ''[[The Restaurant at the End of the Universe]]''
 +
        | 3 = ''[[Life, the Universe and Everything]]''
 +
        | 4 = ''[[So Long, and Thanks for All the Fish]]''
 +
        | 5 = ''[[Mostly Harmless]]''
 +
        | 6 = [[And Another Thing... (novel)|''And Another Thing...'']]
 +
        | #default = <span style="color:red">Error in template H2G2,book: Second parameter not recognised</span>
 +
        }}
 +
 
 +
     | tv =
 +
        episode {{#switch: {{{2}}}
 +
        | 1
 +
        | 2
 +
        | 3
 +
        | 4
 +
        | 5
 +
        | 6 = {{{2}}} of the [[The Hitchhiker's Guide to the Galaxy (TV series)#Episode {{{2}}}|TV series]]
 +
        | #default = <span style="color:red">Error in template H2G2,tv: Second parameter not recognised</span>
 +
        }}
 +
 
 +
     | movie =
 +
        the 2005 movie {{#switch: {{{2}}}
 +
        | 1 = [[The Hitchhiker's Guide to the Galaxy (film)|''The Hitchhiker's Guide to the Galaxy'']]
 +
        | #default = <span style="color:red">Error in template H2G2,movie: Second parameter not recognised</span>
 +
        }}
  
| tv =  
+
    | game =  
    episode {{#switch: {{{2}}}
+
        the computer game {{#switch: {{{2}}}
    | 1
+
        | 1 = [[The Hitchhiker's Guide to the Galaxy (computer game)|''The Hitchhiker's Guide to the Galaxy'']]
    | 2
+
        | 2 = ''[[Starship Titanic]]''
    | 3
+
        | #default = <span style="color:red">Error in template H2G2,game: Second parameter not recognised</span>
    | 4
+
        }}
    | 5
 
    | 6 = {{{2}}} of the [[The Hitchhiker's Guide to the Galaxy (TV series)#Episode {{{2}}}|TV series]]
 
    | #default = <span style="color:red">Error in template H2G2,tv: Second parameter not recognised</span>
 
    }}
 
  
| movie =  
+
    | phase =  
    the 2005 movie {{#switch: {{{2}}}
+
        the radio series {{#switch: {{{2}}}
    | 1 = [[The Hitchhiker's Guide to the Galaxy (film)|''The Hitchhiker's Guide to the Galaxy'']]
+
        | 1 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#The Primary Phase|''The Primary Phase'']]
    | #default = <span style="color:red">Error in template H2G2,movie: Second parameter not recognised</span>
+
        | 2 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#The Secondary Phase|''The Secondary Phase'']]
    }}
+
        | 3 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#The Tertiary Phase|''The Tertiary Phase'']]
 +
        | 4 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#The Quandary Phase|''The Quandary Phase'']]
 +
        | 5 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#The Quintessential Phase|''The Quintessential Phase'']]
 +
        | #default = <span style="color:red">Error in template H2G2,phase: Second parameter not recognised</span>
 +
        }}
  
| game =  
+
    | = {{#switch: {{{2|}}}
    the computer game {{#switch: {{{2}}}
+
        | = <!-- If blanks, do nothing -->
    | 1 = [[The Hitchhiker's Guide to the Galaxy (computer game)|''The Hitchhiker's Guide to the Galaxy'']]
+
        | #default = <span style="color:red">Error in template H2G2: First (blank) parameter not recognised</span>
    | 2 = ''[[Starship Titanic]]''
+
        }}
    | #default = <span style="color:red">Error in template H2G2,game: Second parameter not recognised</span>
 
    }}
 
  
| phase =
+
     | #default = <span style="color:red">Error in template H2G2: First parameter not recognised</span>
    the radio series {{#switch: {{{2}}}
 
    | 1 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#The Primary Phase|''The Primary Phase'']]
 
    | 2 = [[The Hitchhiker's Guide to the Galaxy Primary and Secondary Phases#The Secondary Phase|''The Secondary Phase'']]
 
    | 3 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#The Tertiary Phase|''The Tertiary Phase'']]
 
    | 4 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#The Quandary Phase|''The Quandary Phase'']]
 
    | 5 = [[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#The Quintessential Phase|''The Quintessential Phase'']]
 
     | #default = <span style="color:red">Error in template H2G2,phase: Second parameter not recognised</span>
 
 
     }}
 
     }}
  
| = {{#switch: {{{2|}}}
+
| no = {{#switch: {{{1|}}}
     | = <!-- If blanks, do nothing -->
+
     | radio =
    | #default = <span style="color:red">Error in template H2G2: First (blank) parameter not recognised</span>
+
        {{#switch: {{{2}}}
    }}
+
        | 1 = fit the first
 +
        | 2 = fit the second
 +
        | 3 = fit the third
 +
        | 4 = fit the fourth
 +
        | 5 = fit the fifth
 +
        | 6 = fit the sixth
 +
        | 7 = fit the seventh
 +
        | 8 = fit the eighth
 +
        | 9 = fit the ninth
 +
        | 10 = fit the tenth
 +
        | 11 = fit the eleventh
 +
        | 12 = fit the twelfth
 +
        | 13 = fit the thirteenth
 +
        | 14 = fit the fourteenth
 +
        | 15 = fit the fifteenth
 +
        | 16 = fit the sixteenth
 +
        | 17 = fit the seventeenth
 +
        | 18 = fit the eighteenth
 +
        | 19 = fit the nineteenth
 +
        | 20 = fit the twentieth
 +
        | 21 = fit the twenty-first
 +
        | 22 = fit the twenty-second
 +
        | 23 = fit the twenty-third
 +
        | 24 = fit the twenty-fourth
 +
        | 25 = fit the twenty-fifth
 +
        | 26 = fit the twenty-sixth
 +
        | #default = <span style="color:red">Error in template H2G2,radio: Second parameter not recognised</span>
 +
        }} of the radio series
  
| #default = <span style="color:red">Error in template H2G2: First parameter not recognised</span>
+
    | book =  
}}|{{#switch: {{{1|}}}
+
        the novel {{#switch: {{{2}}}
| radio =
+
        | 1 = ''The Hitchhiker's Guide to the Galaxy''
    {{#switch: {{{2}}}
+
        | 2 = ''The Restaurant at the End of the Universe''
    | 1 = fit the first
+
        | 3 = ''Life, the Universe and Everything''
    | 2 = fit the second
+
        | 4 = ''So Long, and Thanks for All the Fish''
    | 3 = fit the third
+
        | 5 = ''Mostly Harmless''
    | 4 = fit the fourth
+
        | 6 = ''And Another Thing...''
    | 5 = fit the fifth
+
        | #default = <span style="color:red">Error in template H2G2,book: Second parameter not recognised</span>
    | 6 = fit the sixth
+
        }}
    | 7 = fit the seventh
 
    | 8 = fit the eighth
 
    | 9 = fit the ninth
 
    | 10 = fit the tenth
 
    | 11 = fit the eleventh
 
    | 12 = fit the twelfth
 
    | 13 = fit the thirteenth
 
    | 14 = fit the fourteenth
 
    | 15 = fit the fifteenth
 
    | 16 = fit the sixteenth
 
    | 17 = fit the seventeenth
 
    | 18 = fit the eighteenth
 
    | 19 = fit the nineteenth
 
    | 20 = fit the twentieth
 
    | 21 = fit the twenty-first
 
    | 22 = fit the twenty-second
 
    | 23 = fit the twenty-third
 
    | 24 = fit the twenty-fourth
 
    | 25 = fit the twenty-fifth
 
    | 26 = fit the twenty-sixth
 
    | #default = <span style="color:red">Error in template H2G2,radio: Second parameter not recognised</span>
 
    }} of the radio series
 
  
| book =  
+
    | tv =  
    the novel {{#switch: {{{2}}}
+
        episode {{#switch: {{{2}}}
    | 1 = ''The Hitchhiker's Guide to the Galaxy''
+
        | 1
    | 2 = ''The Restaurant at the End of the Universe''
+
        | 2
    | 3 = ''Life, the Universe and Everything''
+
        | 3
    | 4 = ''So Long, and Thanks for All the Fish''
+
        | 4
    | 5 = ''Mostly Harmless''
+
        | 5
    | 6 = ''And Another Thing...''
+
        | 6 = {{{2}}} of the TV series
    | #default = <span style="color:red">Error in template H2G2,book: Second parameter not recognised</span>
+
        | #default = <span style="color:red">Error in template H2G2,tv: Second parameter not recognised</span>
    }}
+
        }}
  
| tv =  
+
    | movie =  
    episode {{#switch: {{{2}}}
+
        the 2005 movie {{#switch: {{{2}}}
    | 1
+
        | 1 = ''The Hitchhiker's Guide to the Galaxy''
    | 2
+
        | #default = <span style="color:red">Error in template H2G2,movie: Second parameter not recognised</span>
    | 3
+
        }}
    | 4
 
    | 5
 
    | 6 = {{{2}}} of the TV series
 
    | #default = <span style="color:red">Error in template H2G2,tv: Second parameter not recognised</span>
 
    }}
 
  
| movie =  
+
    | game =  
    the 2005 movie {{#switch: {{{2}}}
+
        the computer game {{#switch: {{{2}}}
    | 1 = ''The Hitchhiker's Guide to the Galaxy''
+
        | 1 = ''The Hitchhiker's Guide to the Galaxy''
    | #default = <span style="color:red">Error in template H2G2,movie: Second parameter not recognised</span>
+
        | 2 = ''Starship Titanic''
    }}
+
        | #default = <span style="color:red">Error in template H2G2,game: Second parameter not recognised</span>
 +
        }}
  
| game =  
+
    | phase =  
    the computer game {{#switch: {{{2}}}
+
        the radio series {{#switch: {{{2}}}
    | 1 = ''The Hitchhiker's Guide to the Galaxy''
+
        | 1 = ''The Primary Phase''
    | 2 = ''Starship Titanic''
+
        | 2 = ''The Secondary Phase''
    | #default = <span style="color:red">Error in template H2G2,game: Second parameter not recognised</span>
+
        | 3 = ''The Tertiary Phase''
    }}
+
        | 4 = ''The Quandary Phase''
 +
        | 5 = ''The Quintessential Phase''
 +
        | #default = <span style="color:red">Error in template H2G2,phase: Second parameter not recognised</span>
 +
        }}
  
| phase =  
+
    | = {{#switch: {{{2|}}}
    the radio series {{#switch: {{{2}}}
+
        | = <!-- If blanks, do nothing -->
    | 1 = ''The Primary Phase''
+
        | #default = <span style="color:red">Error in template H2G2: First (blank) parameter not recognised</span>
    | 2 = ''The Secondary Phase''
+
        }}
    | 3 = ''The Tertiary Phase''
 
    | 4 = ''The Quandary Phase''
 
    | 5 = ''The Quintessential Phase''
 
    | #default = <span style="color:red">Error in template H2G2,phase: Second parameter not recognised</span>
 
    }}
 
  
| = {{#switch: {{{2|}}}
+
     | #default = <span style="color:red">Error in template H2G2: First parameter not recognised</span>
    | = <!-- If blanks, do nothing -->
 
     | #default = <span style="color:red">Error in template H2G2: First (blank) parameter not recognised</span>
 
 
     }}
 
     }}
  
| #default = <span style="color:red">Error in template H2G2: First parameter not recognised</span>
+
| #default = <span style="color:red">Error in template H2G2: Link parameter not recognised</span>
}}
 
 
}}<noinclude>{{documentation}}<!-- Add categories and interwikis to the /doc subpage, not here! --></noinclude><noinclude>
 
}}<noinclude>{{documentation}}<!-- Add categories and interwikis to the /doc subpage, not here! --></noinclude><noinclude>
  
 
{{template sandbox notice}}
 
{{template sandbox notice}}
 
</noinclude>
 
</noinclude>

Revision as of 20:35, 16 July 2010

Template documentation[view] [edit] [history] [purge]

This template inserts references to the various The Hitchhiker's Guide to the Galaxy versions into Wikipedia articles. The links can be very long winded, so this template makes them easy and consistent.

Compare:

[[The Hitchhiker's Guide to the Galaxy Tertiary to Quintessential Phases#Fit the Fourteenth|fit the fourteenth]] of the radio series

with:

{{H2G2|radio|14|link=yes}}

The template inserts text suitable for use in a list or sentence. This makes pages easy to edit — with shorter, much shorter sources. I tried doing Adams' quotes on Twitter on Towel Day, and he's not very 140 characters.

Articles that can benefit include:

So ...

 BRIANTIST  (talk) 18:45, 28 May 2009 (UTC)

Usage

Link parameter

Use of the template should include the link parameter. Specifying link=yes will transclude text which is linked, and link=no unlinked text. Apart from the linking, the text is identical. The default is to transclude unlinked text.

Examples

{{H2G2|book|1|link=yes}} to {{H2G2|book|6|link=yes}} for the novels:

{{H2G2|radio|1|link=yes}} to {{H2G2|radio|26|link=yes}} for the radio episodes:

{{H2G2|phase|1|link=yes}} to {{H2G2|phase|5|link=yes}} for the radio phases:

{{H2G2|tv|1|link=yes}} to {{H2G2|tv|6|link=yes}} for the TV episodes:

{{H2G2|movie|1|link=yes}} for the film:

{{H2G2|game|1|link=yes}} and {{H2G2|game|2|link=yes}} for the computer games: