Editing
Template:Anchor/doc
(section)
From Deskthority Wiki
Jump to navigation
Jump to search
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!
=== Examples === 1. <code style="color:darkgreen;">{{{{lc:{{BASEPAGENAME}}}}|Foo<nowiki>}}</nowiki></code> : could be linked to with <tt><nowiki>[[#Foo|β¦]]</nowiki></tt> from within the same article, : or it could be linked to with {{nowrap|<tt><nowiki>[[</nowiki>''<small>Article name</small>''#Foo<nowiki>|β¦]]</nowiki></tt>}} from other articles and from redirects. 2. Anchors can be more suitable for inter-article linking than section titles are. For example: :<code>== <span style="color:darkgreen"><nowiki>{{</nowiki>{{lc:{{BASEPAGENAME}}}}<nowiki>|Foo}}</nowiki></span> Section title ==</code> :Here, links via {{nowrap|1=<tt><nowiki>[[</nowiki>''Article name''#Foo<nowiki>]]</nowiki></tt>}} would remain valid even if the section were renamed. See [[#Limitations|Limitations]] for the editing problems this use introduces. :The following is an example of what '''not''' to do: :<code>== Section title <span style="color:darkred"><nowiki>{{</nowiki>{{lc:{{BASEPAGENAME}}}}<nowiki>|Bar}}</nowiki></span> ==</code> :Here, the link {{nowrap|1=<tt><nowiki>[[</nowiki>''Article name''#Bar<nowiki>]]</nowiki></tt>}} would take the user to the section, but could undesirably hide the section title from view. 3. The template can be used to create up to ten anchors with a single call. For example, : {{nowrap|1=<code style="color:darkgreen;"><nowiki>{{</nowiki>{{lc:{{BASEPAGENAME}}}}<nowiki>|Foo|Bar|baz}}</nowiki></code>}} :will create three anchors that can then be linked to with <tt><nowiki>[[#Foo]]</nowiki></tt>, <tt><nowiki>[[#Bar]]</nowiki></tt> and <tt><nowiki>[[#baz]]</nowiki></tt>. :Specifying more than 10 anchors will cause an error message to be displayed.{{#ifeq:{{BASEPAGENAME}}|Visible anchor| <br /> <br /> 4. If the text to be displayed must differ from the anchor (e.g. because it contains brackets for linking), the <code style="color:darkgreen;">text</code> parameter can be used: : {{nowrap|1=<code style="color:darkgreen;"><nowiki>{{</nowiki>{{lc:{{BASEPAGENAME}}}}<nowiki>|Foo|text=[[Foo]]}}</nowiki></code>}} : this will result in a link that constitutes an anchor of its own.|}}
Summary:
Please note that all contributions to Deskthority Wiki 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)
Navigation menu
Page actions
Template
Discussion
Read
Edit source
History
Page actions
Template
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
Deskthority forum
Support Deskthority
Search
Main categories
Guides
Keyboards
Keyboard switches
Keycaps
Keyboard modding
Pointing devices
Brands & companies
Group buys
Other topics
Wiki info & links
Recent changes
Random page
All pages
Deskthority wiki help
MediaWiki help
Tools
What links here
Related changes
Special pages
Page information