Help:Linking to files

From Celeste Wiki
Jump to navigation Jump to search

<languages /> Template:PD Help Page

<translate>

First learn[edit source]

Before you can link to files, you first need to know the basics of: </translate>

<translate>

Not the same as embedding[edit source]

</translate> <translate> This help page is about linking to files.</translate> <translate> Don't confuse that with embedding an image file in a page.</translate> <translate> Although they're both ways of using files, they're not the same.</translate>

<translate> Embedding an image file for example, might be having a person's picture appear alongside the text on a page about that person.</translate> <translate> For information on how to embed an image, see <tvar|1>Template:Ll</>.</translate>

<translate>

Why link?[edit source]

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

<translate>

  • 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).</translate>

<translate>

  • a file may be an image that is so large it's only useful on its own page (for example a detailed map).</translate>

<translate>

  • 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:: </translate>

File:Example.jpg

[[:File:Example.jpg]]

Sunflowers

[[:File:Example.jpg|Sunflowers]]

<translate> Note that if you forget to use the initial colon, you will instead be [[<tvar|images>Special:MyLanguage/Help:Images#Rendering a single image</>|embedding an image]].

Link to actual file[edit source]

</translate> <translate> You can use the pseudo-namespace "<tvar|media>Media</>" to link to the actual file on MediaWiki pages.</translate> <translate> The link will not take you to the file description page, but instead will deliver the file itself.</translate>

Media:Example.jpg

[[Media:Example.jpg]]

Sunflowers

[[Media:Example.jpg|Sunflowers]]

<translate> (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.)

Direct links from external sites[edit source]

Another possibility is to use the <tvar|1>Special:Redirect/file</> page (or its alias <tvar|2>Special:Filepath</>). Unlike the above example, you can link to it from external websites as well as from MediaWiki pages. </translate>

[[Special:Redirect/file/Wikipedia.png]]

<translate> The parameters height and width can also be added to return a specific size of the image.</translate> <translate> The image aspect ratio is always preserved.</translate>

https://www.mediawiki.org/w/index.php?title=Special:Redirect/file/Wikipedia.png&width=100&height=100

[[Category:Help{{#translation:}}|Linking to files]]