Difference between revisions of "Template:IRC"
Jump to navigation
Jump to search
(Fix network not defaulting to EFnet when specified but empty (e.g. {{IRC|foo|}}), which happens via Template:Infobox project) |
(Default channel name to -bs) |
||
Line 2: | Line 2: | ||
This renders an IRC channel name with a link to the webchat interface and takes the following parameters: | This renders an IRC channel name with a link to the webchat interface and takes the following parameters: | ||
* (unnamed): the name of the channel ''without'' the # | * (unnamed): the name of the channel ''without'' the #. Default: <code>archiveteam-bs</code> | ||
* <code>network</code>: the IRC network this channel is/was located on. This can have the values <code>hackint</code> or <code>EFnet</code> (default). | * <code>network</code>: the IRC network this channel is/was located on. This can have the values <code>hackint</code> or <code>EFnet</code> (default). | ||
* <code>abandoned</code>: the presence of a non-empty value for this parameter marks the channel as abandoned. This causes the main output of the template to instead point to the general discussion channel (#archiveteam-bs on hackint) while keeping a reference to the former channel. | * <code>abandoned</code>: the presence of a non-empty value for this parameter marks the channel as abandoned. This causes the main output of the template to instead point to the general discussion channel (#archiveteam-bs on hackint) while keeping a reference to the former channel. | ||
Line 9: | Line 9: | ||
Examples: | Examples: | ||
* <code><nowiki>{{IRC|archiveteam}}</nowiki></code> results in: {{IRC|archiveteam}} | * <code><nowiki>{{IRC|archiveteam}}</nowiki></code> results in: {{IRC|archiveteam}} | ||
* <code><nowiki>{{IRC}}</nowiki></code> results in: {{IRC}} | |||
* <code><nowiki>{{IRC|}}</nowiki></code> results in: {{IRC|}} | |||
* <code><nowiki>{{IRC|channelname|network=hackint}}</nowiki></code> results in: {{IRC|channelname|network=hackint}} | * <code><nowiki>{{IRC|channelname|network=hackint}}</nowiki></code> results in: {{IRC|channelname|network=hackint}} | ||
* <code><nowiki>{{IRC|channelname|hackint}}</nowiki></code> results in: {{IRC|channelname|hackint}} | * <code><nowiki>{{IRC|channelname|hackint}}</nowiki></code> results in: {{IRC|channelname|hackint}} | ||
Line 19: | Line 21: | ||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude><includeonly>{{ #if: {{{abandoned|{{{3|}}}}}} | </noinclude><includeonly>{{ #if: {{{abandoned|{{{3|}}}}}} | ||
|{{#switch:{{{abandoned_render_mode|{{{4|}}}}}}|br+small={{IRC channel|archiveteam-bs|hackint}}<br /><small>(formerly {{IRC channel|{{{1}}}|{{#if:{{{network|{{{2|}}}}}}|{{{network|{{{2|}}}}}}|EFnet}}|_nolink=true}})</small>|#default=<span title="formerly {{IRC channel|{{{1}}}|{{#if:{{{network|{{{2|}}}}}}|{{{network|{{{2|}}}}}}|EFnet}}|_nolink=true}}">{{IRC channel|archiveteam-bs|hackint}}</span>}} | |{{#switch:{{{abandoned_render_mode|{{{4|}}}}}}|br+small={{IRC channel|archiveteam-bs|hackint}}<br /><small>(formerly {{IRC channel|{{#if:{{{1|}}}|{{{1}}}|archiveteam-bs}}|{{#if:{{{network|{{{2|}}}}}}|{{{network|{{{2|}}}}}}|EFnet}}|_nolink=true}})</small>|#default=<span title="formerly {{IRC channel|{{#if:{{{1|}}}|{{{1}}}|archiveteam-bs}}|{{#if:{{{network|{{{2|}}}}}}|{{{network|{{{2|}}}}}}|EFnet}}|_nolink=true}}">{{IRC channel|archiveteam-bs|hackint}}</span>}} | ||
|{{IRC channel|{{{1}}}|{{#if:{{{network|{{{2|}}}}}}|{{{network|{{{2|}}}}}}|EFnet}}}} | |{{IRC channel|{{#if:{{{1|}}}|{{{1}}}|archiveteam-bs}}|{{#if:{{{network|{{{2|}}}}}}|{{{network|{{{2|}}}}}}|EFnet}}}} | ||
}}</includeonly> | }}</includeonly> |
Revision as of 05:56, 31 October 2021
This renders an IRC channel name with a link to the webchat interface and takes the following parameters:
- (unnamed): the name of the channel without the #. Default:
archiveteam-bs
network
: the IRC network this channel is/was located on. This can have the valueshackint
orEFnet
(default).abandoned
: the presence of a non-empty value for this parameter marks the channel as abandoned. This causes the main output of the template to instead point to the general discussion channel (#archiveteam-bs on hackint) while keeping a reference to the former channel.abandoned_render_mode
: how the abandoned channel should be rendered. Possible values areinline
(default) andbr+small
. See below for examples.
Examples:
{{IRC|archiveteam}}
results in: #archiveteam (on EFnet){{IRC}}
results in: #archiveteam-bs (on EFnet){{IRC|}}
results in: #archiveteam-bs (on EFnet){{IRC|channelname|network=hackint}}
results in: #channelname (on hackint){{IRC|channelname|hackint}}
results in: #channelname (on hackint){{IRC|foo|EFnet|abandoned}}
results in (note the hover text): #archiveteam-bs (on hackint)
The br+small
render mode produces two lines of output: {{IRC|foo|EFnet|abandoned|br+small}}
results in:
#archiveteam-bs (on hackint)
(formerly #foo (on EFnet))