Jump to content

Help:Linking to files

From MattWiki

First learn[edit source]

Before you can link to files, you first need to know the basics of:

Not the same as embedding[edit source]

This help page is about linking to files. Don't confuse that with embedding an image file in on a page. Although they're both ways of using files, they're not the same. Embedding an image file for example, might be having a person's picture appear alongside the text on a page about that person. For information on how to embed an image, see Help:ImagesHelp:Images.

Why link?[edit source]

In some situation, you don't want the file to be embedded in another page. You want a link on the page to take you to the file description page of a particular file. Or you may want the link to take you to the file itself. Here are some examples where you likely want to link rather than embed:

  • a file of a type that cannot be embedded in a page (for example, a spreadsheet -- assuming the wiki allows such file types to be uploaded at all).
  • a file may be an image that is so large it's only useful on its own page (for example a detailed map).
  • you want to refer the readers to where they can download or replace the file.

Link to a file description page[edit source]

You can create a link to a file's file description page by using a colon (:) before File::

[[:File:MediaWiki:Image sample]]

[[:File:MediaWiki:Image sample]]

[[:File:MediaWiki:Image sample|Sunflowers]]

[[:File:MediaWiki:Image sample|Sunflowers]]

Note that if you forget to use the initial colon, you will instead be embedding an image.

Link to actual file[edit source]

Use the pseudo-namespace "<tvar|media>Media" for a link to the actual file. The link will not take you to the file description page, but instead will deliver the file itself.

[[Media:MediaWiki:Image sample]]

[[Media:MediaWiki:Image sample]]

[[Media:MediaWiki:Image sample|Sunflowers]]

[[Media:MediaWiki:Image sample|Sunflowers]]

(If the above pattern actually produces a text link to the file description page, instead of the expected link to the actual file, it may be that your wiki's namespaces are configured out of compliance with this feature.)

This page was moved from mw:Help:Linking to files. It's edit history can be viewed at Help:Linking to files/edithistory