User:One cookie/sandbox

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Documentation

Produces a particular sort of hatnote for a bit of disambiguation, like these:





...from a relatively small amount of wikicode. The following snippets create the examples above:

{{User:One cookie/sandbox/Template:Category contains|big trucks|f=small trucks|f1=Category:Chevrolet vehicles}}

{{User:One cookie/sandbox/Template:Category contains|trumpet man [[Miles Davis]]|m=ogg files|f=saxophone people|f1=Category:Jazz saxophonists|f2=Category:Saxophonists from Hungary|s1=Charlie Parker|s2=John Coltrane|t1=🎺  }}

{{User:One cookie/sandbox/Template:Category contains|authoritarians|a1=Category:Dictatorship|a2=Category:Women taller than men|a3=File:Social. Irma Byck. Leon Davicko BAnQ P48S1P15901.jpg}}

It goes:

{{ template name | t1= | p= | m= | {{{1}}}= | f= | f1= | f2= | ff= | ff1= | ff2= | fff= | fff1= | fff2= | ffff= | ffff1= | ffff2= | a1= | a2= | s1= | t2= }}

The parameters, and where they end up:

  • t1
  • This p contains m relating to {{{1}}}.
  • For media relating to f, see f1, f2, f3 or f4 (...etc.).
  • For media relating to ff, see ff1 or ff2 (...etc.).
  • For media relating to fff, see fff1 or fff2 (...etc.).
  • For media relating to ffff, see ffff1, ffff2 or ffff3 (...etc.).
  • See also a1, a2 and a3 (...etc.).
  • Or try searching for s1, s2, s3, s4, s5 or s6 (...etc.).
  • t2


If you enter nothing, {{User:One cookie/sandbox/Template:Category contains}}, you get:


If you only enter that one parameter, like {{User:One cookie/sandbox/Template:Category contains|STUFF}}, you get:


That parameter, {{{1}}}, is an unnamed parameter, it has no name. You do not need to do |thing=thing for it , the = is you choosing a specific named parameter. The number is the position in the order of unnamed parameters at which it is used, {{{1}}} comes before {{{2}}}, etc. So {{{1}}} has to be the one that comes 1ˢᵗ, the first simple |string entered, the |string that is first is the one that ends up in the code where {{{1}}} is. Discover more at w:Anatomy of a template.

p is for page, it defaults to "category" if you ignore it, since category pages are where I imagine this being at all useful.

m is for media, and it defaults to "media" if ignored. You can change it for categories where everything is a photo or an .ogg or whatever.

The limits are four "for media relating to" entries, each with a maximum of 8 links. You get 9 "see also" entries, and 9 search options. Don't go anywhere near those limits because it would be a very annoying piece of text.

You get |t1= and |t2= for free. The other ones punctuate themselves, but those two have nothing, so bring your own. I used |t1= to do that trumpet thing up top.

Even though there's a {{{1}}}, it is the only unnamed parameter, so none of the positions matter and you can get weird with it. But it's easier to keep track of if you don't get weird with it.

Example:

sensible not sensible
{{User:One cookie/sandbox/Template:Category contains
|p=jazz stand
|m=me, while I am
|the word {{font|font=Century Gothic|color=salmon|size=120%|text=Bathroom}} in salmon
|f=[[w:that darn cat!|that darn cat]]
|f1=category:desks
|f2=dawn
|f3=hands
|f4=category:f
|f5=w:Category:Rhinoceroses in popular culture
|ff=[[w:Special:Search/intitle:"Charles"|Charleses]]
|ff1=meat
|ff2=sleals
|ff7=file:Anime Expo 2011 - Black Mages from Final Fantasy (5917374575).jpg
|fff=the train man
|fff1=Category:wrecks
|fff2=Category:explosions
|fff4=File:Gustav Holst - Second Suite in F - III. Song of the Blacksmith.ogg
|ffff=all that yiffin ya did
|ffff1=war (HUNH)
|ffff7=train man houses
|a=pokemon
|a1=Commons:Categories
|a2=weasel eating type people
|s1=my dad
|s2=statistics about previous train men
|s3=am i inside?
|s4=it
|s6=mrs penelopy from thunder bird
|t=There isnt a man alive who could take me, ill tell you that right nowyins.}}
{{User:One cookie/sandbox/Template:Category contains
|fff2=category:explosions
|f2=dawn
|f3=hands
|ffff7=train man houses
|fff=the train man
|fff1=category:wrecks
|f4=category:f
|ff=[[w:Special:Search/intitle:"Charles"|Charleses]]
|s2=statistics about previous train men
|s4=it
|s6=mrs penelopy from thunder bird
|the word {{font|font=Century Gothic|color=salmon|size=120%|text=Bathroom}} in salmon
|ff1=meat
|ff2=sleals
|ffff=all that yiffin ya did
|a1=Commons:Categories
|ff7=file:Anime Expo 2011 - Black Mages from Final Fantasy (5917374575).jpg
|a2=weasel eating type people
|ffff1=war (HUNH)
|f=[[w:that darn cat!|that darn cat]]
|fff4=File:Gustav Holst - Second Suite in F - III. Song of the Blacksmith.ogg
|f1=category:desks
|f5=w:Category:Rhinoceroses in popular culture
|p=jazz stand
|s1=my dad
|m=me, while I am
|s3=am i inside?
|a=pokemon
|t=There int a man alive who could take me, ill tell you that right nowyins.}}

Only one of those makes sense to look at, but both of them would produce this:


Notice that you can do things like make the |p= and the |m= be links, do interwiki linking, do piped links (but not in the suggestions, they have to be the exact page titles) and file links and probably other things too.

If you only give the option of a search, it omits the "or", which makes it seem kinda snarky?


({{User:One cookie/sandbox/Template:Category contains|men who sleep with fishes|s1=men who sleep with da fishes}})