Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Numinix MediaWiki Demo
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Help/Links
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Anchors == <!--T:253--> === Linking to an anchor === <!--T:254--> </translate> <translate><!--T:255--> Links in the format <tvar name=1><code><nowiki>[[#anchor_name]]</nowiki></code></tvar> will direct to the first matching anchor on the page, typically corresponding to the first identical section heading.</translate> <translate><!--T:256--> You can add an <tvar name=1><code><nowiki>[[#anchor_name]]</nowiki></code></tvar> to a link, directing it to the first matching section heading (or anchor) on the '''named''' page:</translate> <code><nowiki>[[Help:Editing#Advanced editing]]</nowiki></code> <code><nowiki>https://www.mediawiki.org/wiki/Help:Editing#Advanced_editing</nowiki></code> <translate> === Using an automatic anchor === <!--T:257--> </translate> <translate><!--T:258--> Section headings serve as anchors, using the heading text as the anchor name.</translate> <translate><!--T:259--> If there are multiple sections with identical headings, each subsequent occurrence is appended with <tvar name=1>"_2", "_3"</tvar>, etc.</translate> <translate> <!--T:260--> The anchor <tvar name=1>[[#toc]]</tvar> links to the page's table of contents (TOC), except when there's a section already titled <tvar name=2>"toc"</tvar>. === A manual anchor === <!--T:261--> </translate> <translate><!--T:262--> Manually-set anchors are beneficial for linking to "unlinkable" elements such as tables (titles or cells) or sections of plain text.</translate> <translate><!--T:263--> For instance, in the [[<tvar name=1>#External links to internal pages</tvar>|External links to internal pages]] section above, although the column text "Description" resembles a (minor) heading, it is not.</translate> <translate><!--T:264--> There are several methods to set an anchor at any position:</translate> * <translate><!--T:265--> The "anchor" [[<tvar name=1>help:Template</tvar>|template]], if it exists on your wiki, specified as <tvar name=2></tvar>, offers a standardized method to create anchor points.</translate> <translate><!--T:266--> Place the template where you want, using the syntax <tvar name=2><nowiki></nowiki></tvar>.</translate> <translate><!--T:267--> For instance, <nowiki></nowiki> is placed in the "Description" column of the table below the "External links to internal pages" section.</translate> <translate><!--T:268--> Clicking on <tvar name=1>[[#Description]]</tvar> links to that anchor point created on the table.</translate> <translate><!--T:269--> The anchor is only visible via the source code.</translate> * <translate><!--T:270--> Use the generic anchor tag <tvar name=1><code><nowiki><span id="anchor_name">some text</span></nowiki></code></tvar> with optional text for visible anchors.</translate> <translate><!--T:271--> For hidden anchors, omit the text.</translate> <translate><!--T:272--> To point to the anchor use <tvar name=1><code><nowiki>[[#anchor_name]]</nowiki></code></tvar>.</translate> * <translate><!--T:273--> Avoid using manual HTML headings like <tvar name=1><code><nowiki><h2>Editing Instructions</h2></nowiki></code></tvar>.</translate> <translate><!--T:274--> This text serves as an <tvar name=1>anchor_name</tvar>.</translate> * <translate><!--T:275--> In certain instances, adding an ID attribute similar to HTML within a Wiki-element is necessary.</translate> <translate><!--T:276--> Take, for instance, the table mentioned earlier, titled [[<tvar name=1>#External links to internal pages</tvar>|External links to internal pages]]:</translate> :<code><nowiki> border="1" class="wikitable" id="You type" </nowiki></code> * <translate><!--T:277--> A top of a page can be accessed using the reserved term <tvar name=1><code><nowiki>[[#top]]</nowiki></code></tvar>.</translate> <translate> <!--T:278--> See also [[<tvar name=1>Special:MyLanguage/Help:Section#Linking sections using an arbitrary id</tvar>|Help:Section#Linking sections using an arbitrary ID]]. === Using Linksearch anchors === <!--T:279--> <!--T:280--> As mentioned above, if external link style is used, e.g. <tvar name=1>[https://www.mediawiki.org/wiki/Help:Section#Linking_sections_using_an_arbitrary_id]</tvar>, we can use <tvar name=2>[[Special:Linksearch]]</tvar>: <tvar name=3>[https://www.mediawiki.org/wiki/Special:LinkSearch]</tvar>. </translate> <translate><!--T:281--> When using Linksearch, it's helpful to add leading zeros to numerical anchor names to prevent unintended matches.</translate> <translate><!--T:282--> For example, instead of searching for "1", use "01" to avoid including "10".</translate> <translate><!--T:283--> This practice is seen in [[w:Template:Current events header|Template:Current events header]].</translate> <translate><!--T:284--> Similarly, if there are anchors like "a" and "ab", using "_a" can distinguish them in search results.</translate> <translate> === Using <tvar name=1>anchorencode</tvar> === <!--T:285--> </translate> <translate><!--T:286--> The <tvar name=1><code>#anchorencode</code></tvar> parser function encodes input to use as an anchor.</translate> <translate><!--T:287--> For example, to external link to <tvar name=1>[[#Using linksearch anchors]]</tvar> above, you would use <tvar name=2><code><nowiki>https://www.mediawiki.org/wiki/Help:Links#</nowiki></code></tvar>, which resolves to <tvar name=3>https://www.mediawiki.org/wiki/Help:Links#</tvar></translate> <translate>
Summary:
Please note that all contributions to Numinix MediaWiki Demo may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)