Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

-

Historians wanted: Inquire here.

Template:Plainlinks: Difference between revisions

Template page
Add docs
m Use interwiki syntax
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude><includeonly><span class="plainlinks">[{{{1}}} {{{2}}}]</span></includeonly></onlyinclude>
<onlyinclude><includeonly><span class="plainlinks">[{{#ifeq:{{#sub:{{{1}}}|0|1}}|/|{{#ifeq:{{#sub:{{{1}}}|1|1}}|/||https://tas.bot}}|}}{{{1}}} {{{2}}}]</span></includeonly></onlyinclude>
This template saves you from remembering the exact syntax for <code><nowiki><span class="plainlinks"/></nowiki></code> [https://www.mediawiki.org/wiki/Help:Links#External_links_to_internal_pages external-internal links].
 
Invoke it as <code><nowiki>{{plainlinks|1=https://wiki.tas.bot/wiki/SomePage?with=params|2=link label}}</nowiki></code> (both parameter indices must be specified explicitly).
This template saves you from remembering the exact syntax for <code><nowiki><span class="plainlinks"/></nowiki></code> [[mw:Help:Links#External_links_to_internal_pages|external-internal links]].
Usage:
* <code><nowiki>{{plainlinks|/wiki/dwangoAC|click here}}</nowiki></code> &longrightarrow; {{plainlinks|/wiki/dwangoAC|click here}}
* <code><nowiki>{{plainlinks|1=/wiki/SomePage?with=params|2=click here}}</nowiki></code> &longrightarrow; {{plainlinks|1=/wiki/SomePage?with=params|2=click here}} (both parameter indices must be specified explicitly when the first contains '=')
* External links should be marked as such, so while the below examples will work, think twice about using this template.
** <code><nowiki>{{plainlinks|https://xkcd.com|click here}}</nowiki></code> &longrightarrow; {{plainlinks|https://xkcd.com|click here}}
** <code><nowiki>{{plainlinks|//example.com|click here}}</nowiki></code> &longrightarrow; {{plainlinks|//example.com|click here}}
 
{{TemplateData preamble}}<templatedata>
{
"params": {
"1": {
"label": "URI",
"description": "for local links (what this is meant for), omit protocol+domain but include leading '/'",
"type": "url",
"required": true
},
"2": {
"label": "Label text",
"type": "line",
"required": true
}
},
"format": "inline",
"description": "Shorthand for a plainlinks span, used to hide the external link indicator from a link."
}
</templatedata>

Latest revision as of 11:19, 7 September 2025


This template saves you from remembering the exact syntax for <span class="plainlinks"/> external-internal links. Usage:

  • {{plainlinks|/wiki/dwangoAC|click here}}click here
  • {{plainlinks|1=/wiki/SomePage?with=params|2=click here}}click here (both parameter indices must be specified explicitly when the first contains '=')
  • External links should be marked as such, so while the below examples will work, think twice about using this template.
    • {{plainlinks|https://xkcd.com|click here}}click here
    • {{plainlinks|//example.com|click here}}click here

The below documentation is automatically generated from JSON.

It can be changed by editing this page, but note that it's only the documentation (for the visual editor)—the actual template part must also be edited, manually.

Shorthand for a plainlinks span, used to hide the external link indicator from a link.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
URI1

for local links (what this is meant for), omit protocol+domain but include leading '/'

URLrequired
Label text2

no description

Linerequired