Difference between revisions of "Template:IRC"

From Archiveteam
Jump to navigation Jump to search
(Fix hackint web chat URL: there should be no leading hash on the channel name)
(Fix network not defaulting to EFnet when specified but empty (e.g. {{IRC|foo|}}), which happens via Template:Infobox project)
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
For an IRC channel name with a link to EFnet's web IRC interface (or another network's web interface, if available as an option). The sole parameter is the name of the channel (# sign must be omitted).
This renders an IRC channel name with a link to the webchat interface and takes the following parameters:


Example:
* (unnamed): the name of the channel ''without'' the #
* <code>{<nowiki/>{IRC|archiveteam}<nowiki/>}</code> results in {{IRC|archiveteam}}
* <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_render_mode</code>: how the abandoned channel should be rendered. Possible values are <code>inline</code> (default) and <code>br+small</code>. See below for examples.


If the <code>{{!}}network=</code> parameter is specified (e.g. <code>hackint</code>), then the template will link to that network instead. You can also use the second unnamed parameter (or <code>{{!}}2=</code>).
Examples:
* <code><nowiki>{{IRC|archiveteam}}</nowiki></code> results in: {{IRC|archiveteam}}
* <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|foo|EFnet|abandoned}}</nowiki></code> results in (note the hover text): {{IRC|foo|EFnet|abandoned}}


Examples:
The <code>br+small</code> render mode produces two lines of output: <code><nowiki>{{IRC|foo|EFnet|abandoned|br+small}}</nowiki></code> results in:
* <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}}


Currently supported networks are <code>efnet</code> (default) and <code>hackint</code>.
{{IRC|foo|EFnet|abandoned|br+small}}


[[Category:Templates]]
[[Category:Templates]]
</noinclude><includeonly><span class="plainlinks">[{{#switch:{{{network|{{{2|}}}}}}|hackint=https://webirc.hackint.org/#irc://irc.hackint.org/{{{1}}}|#default=http://chat.efnet.org:9090/?channels=%23{{{1}}}}} #{{{1}}}]</span> (on {{#switch:{{{network|{{{2|}}}}}}|hackint=hackint|#default=EFnet}})</includeonly>
</noinclude><includeonly>{{ #if: {{{abandoned|{{{3|}}}}}}
  |{{#switch:{{{abandoned_render_mode|{{{4|}}}}}}|br+small={{IRC channel|archiveteam-bs|hackint}}<br /><small>(formerly&nbsp;{{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>}}
  |{{IRC channel|{{{1}}}|{{#if:{{{network|{{{2|}}}}}}|{{{network|{{{2|}}}}}}|EFnet}}}}
}}</includeonly>

Revision as of 03:15, 27 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 #
  • network: the IRC network this channel is/was located on. This can have the values hackint or EFnet (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 are inline (default) and br+small. See below for examples.

Examples:

  • {{IRC|archiveteam}} results in: #archiveteam (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))