Difference between revisions of "Template:Text anchor"

From RRU Knowledge Base
Line 1: Line 1:
<includeonly><span id="{{#if:{{{2|}}}|{{{2|}}}|{{{1|}}}}}" class="text-anchor">{{{1}}}</span></includeonly><noinclude>
<includeonly><span id="{{#if:{{{2}}}|{{{2}}}|{{{1}}}}}" class="text-anchor">{{{1}}}</span></includeonly><noinclude>
==Documentation==
==Documentation==
This template renders enclosed text in a <code><nowiki><span id="Unique anchor name"></span></nowiki></code> inline, with the text inside the span also being used as the <code>unique anchor name</code>. This creates an anchor link that can be linked to with <code><nowiki>[[#Unique anchor name]]</nowiki></code> on the same page or <code><nowiki>[[Page name#Unique anchor name]]</nowiki></code> on a different page.
This template renders enclosed text in a <code><nowiki><span id="Unique anchor name"></span></nowiki></code> inline, with the text inside the span also being used as the <code>unique anchor name</code>. This creates an anchor link that can be linked to with <code><nowiki>[[#Unique anchor name]]</nowiki></code> on the same page or <code><nowiki>[[Page name#Unique anchor name]]</nowiki></code> on a different page.
Line 6: Line 6:
*<code><nowiki>{{text anchor|Example anchor 1}}</nowiki></code> →<br \>{{text anchor|Example anchor 1}}
*<code><nowiki>{{text anchor|Example anchor 1}}</nowiki></code> →<br \>{{text anchor|Example anchor 1}}


*<code><nowiki>{{text anchor|Example anchor 2|Anchor link name example}}</nowiki></code> →<br \>{{text anchor|Example anchor 2|Anchor link name example}}
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
*<code><nowiki>{{text anchor|Example anchor 2|Anchor link name example}}</nowiki></code> →<br \>{{text anchor|Example anchor 2|Testing}}


{{anchor|An example}} of its usage is <code><nowiki>{{anchor|An example}}</nowiki></code>, which turns the first two words in this sentence into an anchor that can be linked to with <code><nowiki>[[#An example]]</nowiki></code> from this page or <code><nowiki>[[Template:Anchor#An example]]</nowiki></code> from a different page.
{{anchor|An example}} of its usage is <code><nowiki>{{anchor|An example}}</nowiki></code>, which turns the first two words in this sentence into an anchor that can be linked to with <code><nowiki>[[#An example]]</nowiki></code> from this page or <code><nowiki>[[Template:Anchor#An example]]</nowiki></code> from a different page.

Revision as of 04:14, 2 December 2017

Documentation

This template renders enclosed text in a <span id="Unique anchor name"></span> inline, with the text inside the span also being used as the unique anchor name. This creates an anchor link that can be linked to with [[#Unique anchor name]] on the same page or [[Page name#Unique anchor name]] on a different page.

Usage instructions

  • {{text anchor|Example anchor 1}}
    Example anchor 1

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

  • {{text anchor|Example anchor 2|Anchor link name example}}
    Example anchor 2

of its usage is {{anchor|An example}}, which turns the first two words in this sentence into an anchor that can be linked to with [[#An example]] from this page or [[Template:Anchor#An example]] from a different page.


Usage instructions

This template renders enclosed text in a <span id="Unique anchor name"></span> inline, with the text inside the span also being used as the unique anchor name. This creates an anchor that can be linked to with [[#Unique anchor name]] on the same page or [[Template:Anchor#Unique anchor name]] on a different page.

  • {{anchor|test}}