ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Template:Anchor: Difference between revisions

From ModEnc
Jump to navigation Jump to search
m Sigh...
Vinifera7 (talk | contribs)
Cross your fingers...
Line 1: Line 1:
<includeonly><span class="plainlinks" id="{{#ifeq:{{{2|anchor}}}|||{{{2|anchor}}}_}}{{{1}}}">[{{fullurl:{{FULLPAGENAME}}#{{#ifeq:{{{2|anchor}}}|||{{{2}}}_}}{{{1}}}}} {{{3|{{{1}}}}}}]</span></includeonly><noinclude>Usage:<pre>{{Anchor|name|prefix?|title?}}</pre>Creates a link to this page and this text, to easily reference this text. Creates an anchor named "#prefix_name" and titled "title". Prefix defaults to "anchor", title defaults to name.<br>'''Example:'''<pre>{{Anchor|reference1}}</pre>results in {{Anchor|reference1}}<br><br></noinclude>
<includeonly>{{#if:{{{1|}}}|<span class="plainlinks" id="{{#ifeq:{{{2}}}|||{{{2|anchor}}}_}}{{{1}}}">{{#ifeq:{{{3}}}|||[{{fullurl:{{FULLPAGENAME}}#{{#ifeq:{{{2}}}|||{{{2|anchor}}}_}}{{{1}}}}} {{{3|{{{1}}}}}}]}}</span>|{{co|{{{1}}}|red}}}}</includeonly><noinclude>
==Usage==
{{Anchor{{!}}{{co|id|red}}{{!}}{{co|prefix|green}}?{{!}}{{co|hypertext|blue}}?}}
Creates an anchor to this page specified by {{tt|{{co|id|red}}}}, to easily reference the text specified by {{tt|{{co|hypertext|blue}}}}. If not empty, {{tt|{{co|prefix|green}}_}} will be added before {{tt|{{co|id|red}}}} in the anchor namespace. {{tt|{{co|prefix|green}}}} defaults to {{tt|anchor}} if undefined. Hypertext for the anchor will be created if {{tt|{{co|hypertext|blue}}}} is not empty. {{tt|{{co|hypertext|blue}}}} defaults to {{co|id|red}}.
 
===Example===
<pre>{{Anchor|reference1}}</pre>
This code results in {{Anchor|reference1}}
</noinclude>

Revision as of 20:07, 20 May 2008

Usage

{{Anchor|id|prefix?|hypertext?}}

Creates an anchor to this page specified by id, to easily reference the text specified by hypertext. If not empty, prefix_ will be added before id in the anchor namespace. prefix defaults to anchor if undefined. Hypertext for the anchor will be created if hypertext is not empty. hypertext defaults to id.

Example

{{Anchor|reference1}}

This code results in reference1