Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mediawiki link within the page to a specific place, rather than a section

1. Question

If I code like the following, then I have a link within the page to a specific "section"

[[#SectionTitle|displayed text]]

But what if I want to have a link within the page to a place, I mean any place?

Sometimes I might want to directly refer to a part of the page that isn't at the start of a section.

2. What I tried

I tried something like this

[[#Foo|displayed text]]
{{anchor|Foo}}

This seemed to ask me to make a page Template:Anchor

So I copied the Template:Anchor page of wikipedia.

But Template:Anchor again seemed to ask to make some new page, because Template:Anchor only says

{{#invoke:anchor|main}}

So my attempt didn't work.

like image 356
user1849133 Avatar asked May 14 '14 13:05

user1849133


1 Answers

Use the following to create the anchor:

<div id="NameOfAnchorHere">optional text</div>

which can be referenced as:

[[#NameOfAnchorHere| test]]

More information about linking in MediaWiki can be found here

like image 88
ebo Avatar answered Nov 01 '22 05:11

ebo