Help:Files

From The Sims Wiki, a collaborative database for The Sims series
Jump to navigation Jump to search
This page is a help page
It is meant to detail processes or procedures of some aspect or aspects of The Sims Wiki's norms and practices. It is not a policy page.

A file is a type of media content that can be displayed on a page. Types of files include images, video, audio clips, and more. Files can be uploaded using the upload page, and will be stored in the File namespace (where page titles begin with the prefix File:, note the colon). Files can be embedded and displayed on a page using the syntax [[File:Name of file]], much like a regular wikilink.

Permitted file types[edit source]

The following file types can be uploaded to The Sims Wiki:

Images:

Audio:

Video:

Documents:

Uploading files[edit source]

Before a file can be used on The Sims Wiki, it must be uploaded to the wiki first. When uploading, please keep the following in mind:

  • Files on The Sims Wiki must have a unique name. For example, if there is already a file named "Flower.jpg" on The Sims Wiki, you cannot upload another file of the exact same name without overriding it.
  • Please give your files a specific name. This will help reduce conflicts and make it easier for others to know what your file is about. For example, "Sunflowers growing off Highway 50 in Leslieville.jpg" is a much better name than "Sunflowers.jpg" or "Highway 50.jpg". You will have the option to rename your file when it is being uploaded.
  • You can use the same file on multiple pages on the wiki, or even multiple times on the same page. As such, please try to avoid uploading duplicates.

Once you have uploaded a file, it will not appear on any pages at first, although it will exist on the servers and can be used at any time. You can use files on a page by typing [[File:filename.extension]], replacing filename.extension with the name of the file as you uploaded it as. For example, if you uploaded a file called Portrait of John Doe.jpg, you would use it in an article by editing the article you want to add the file to and typing [[File:Portrait of John Doe.jpg]] onto the page.

Like regular wiki pages, files have revision histories too. When a file with the same name as an existing file gets uploaded, it will override the existing file. All previous versions of a file are kept in the file's file history, and can be viewed by anyone. Anyone who can upload files can also revert a file to an older version.

File description page[edit source]

When you upload a file to The Sims Wiki, a file description page is automatically created for it. These pages are used to contain important information relating to the file, such as its licensing and copyright status, the author who created it, where it was produced, and any modifications made to it. File description pages are located in the "File" namespace, and as such, their page names will begin with File: (note the colon). Their names will correspond to the name of the file on the wiki. For example, if you upload a file titled "John Doe.jpg", the file description page for that file will be "File:John Doe.jpg".

When you view a file description page, the most current version of the uploaded file will be displayed at the top, and the contents of the file description page will appear below it. When you click the "Edit" button on a file description page, you will be able to edit the file description page, but not the uploaded file itself.

Files from Commons[edit source]

Files from the Wikimedia Commons can also be used on The Sims Wiki. The Wikimedia Commons is a free-to-use media repository that contains over 50 million images, audio clips, and video files that can be used on The Sims Wiki without having to be uploaded again. Files from the Wikimedia Commons can also be used on Wikipedia, Wiktionary, and other Wikimedia-related sites.

When you view the file description page for a file that is being hosted on the Wikimedia Commons, the following message will appear:

File from Commons
This file is from the Wikimedia Commons. Information from its description page there is shown below.

The Wikimedia Commons only accepts freely usable files; this means that most copyrighted images on the Internet cannot be uploaded to Commons. You will need a separate Wikimedia account in order to upload to Commons as well. You can upload files to the Wikimedia Commons using their Upload Wizard.

Embedding images[edit source]

The syntax to embed a single image is:

[[File:filename.extension|options|caption]]

options can either be excluded (which will show the image in its full size), or contain one or more of the following parameters, each separated by pipes (|), that can be used to resize and format the image for better display.

Format[edit source]

Formatting options control how the rendered image is formatted and embedded in the rest of the page.

If the height of an image in thumbnail is bigger than its width (i.e. in portrait orientation rather than landscape) and you find it too large, you may try the option upright=N, where N is the image's aspect ratio (its width divided by its height, defaulting to 0.75). The alternative is to specify the desired maximum height (in pixels) explicitly.

You can also use thumb={filename} to specify a different image for the thumbnail.

Size and frame[edit source]

The size parameter can be used to resize the image, either to fit within a given resolution in pixels, or to resize them according to the user's preferences. The image will always retain its aspect ratio.

Horizontal alignment[edit source]

When using the frame or thumb[nail] formats, the default alignment will always be right.

Vertical alignment[edit source]

The vertical alignment options take effect only if the image is rendered as an inline element and is not floating. They alter the way the inlined image will be vertically aligned with the text present in the same block before and/or after this image on the same rendered row.

Note that the rendered line of text where inline images are inserted (and the lines of text rendered after the current one) may be moved down (this will increase the line-height conditionally by additional line spacing, just as it may occur with spans of text with variable font sizes, or with superscripts and subscripts) to allow the image height to be fully displayed with this alignment constraint.

View source code
<p style="border:1px solid #AAA;padding:0;font-size:150%;line-height:2">
<span style="background:#FFF;color:#000;text-decoration:overline"><u><del>text</del>
'''top:''' [[File:Example.jpg|20px|top]] [[File:Example.jpg|40px|top]] [[File:Example.jpg|100px|top]]
<del>text</del></u></span></p>
 
<p style="border:1px solid #AAA;padding:0;font-size:150%;line-height:2">
<span style="background:#FFF;color:#000;text-decoration:overline"><u><del>text</del>
'''text-top:''' [[File:Example.jpg|20px|text-top]] [[File:Example.jpg|40px|text-top]] [[File:Example.jpg|100px|text-top]]
<del>text</del></u></span></p>
 
<p style="border:1px solid #AAA;padding:0;font-size:150%;line-height:2">
<span style="background:#FFF;color:#000;text-decoration:overline"><u><del>text</del>
<sup>super:</sup> [[File:Example.jpg|20px|super]] [[File:Example.jpg|40px|super]] [[File:Example.jpg|100px|super]]
<del>text</del></u></span></p>
 
<p style="border:1px solid #AAA;padding:0;font-size:150%;line-height:2">
<span style="background:#FFF;color:#000;text-decoration:overline"><u><del>text</del>
'''baseline:''' [[File:Example.jpg|20px|baseline]] [[File:Example.jpg|40px|baseline]] [[File:Example.jpg|100px|baseline]]
<del>text</del></u></span></p>
 
<p style="border:1px solid #AAA;padding:0;font-size:150%;line-height:2">
<span style="background:#FFF;color:#000;text-decoration:overline"><u><del>text</del>
<sub>'''sub:'''</sub> [[File:Example.jpg|20px|sub]] [[File:Example.jpg|40px|sub]] [[File:Example.jpg|100px|sub]]
<del>text</del></u></span></p>
 
<p style="border:1px solid #AAA;padding:0;font-size:150%;line-height:2">
<span style="background:#FFF;color:#000;text-decoration:overline"><u><del>text</del>
'''default:''' [[File:Example.jpg|20px]][[File:Example.jpg|40px]] [[File:Example.jpg|100px]]
<del>text</del></u></span></p>
 
<p style="border:1px solid #AAA;padding:0;font-size:150%;line-height:2">
<span style="background:#FFF;color:#000;text-decoration:overline"><u><del>text</del>
'''middle:''' [[File:Example.jpg|20px|middle]] [[File:Example.jpg|40px|middle]] [[File:Example.jpg|100px|middle]]
<del>text</del></u></span></p>
 
<p style="border:1px solid #AAA;padding:0;font-size:150%;line-height:2">
<span style="background:#FFF;color:#000;text-decoration:overline"><u><del>text</del>
'''text-bottom:''' [[File:Example.jpg|20px|text-bottom]] [[File:Example.jpg|40px|text-bottom]] [[File:Example.jpg|100px|text-bottom]]
<del>text</del></u></span></p>
 
<p style="border:1px solid #AAA;padding:0;font-size:150%;line-height:2">
<span style="background:#FFF;color:#000;text-decoration:overline"><u><del>text</del>
'''bottom:'' [[File:Example.jpg|20px|bottom]] [[File:Example.jpg|40px|bottom]] [[File:Example.jpg|100px|bottom]]
<del>text</del></u></span></p>

To show the alignment result more clearly, the text spans are overlined and underlined, the font-size is increased to 200%, and the paragraph block is outlined with a thin border; additionally images of different sizes are aligned:

text top: text

text text-top: text

text super: text

text baseline: text

text sub: text

text default: text

text middle: text

text text-bottom: text

text bottom: text

Notes:

  1. The "middle" vertical alignment position of the image (which is also the default) usually refers to the middle between the x-height and the baseline of the text (on which the vertical middle of the image will be aligned, and on which usually the text may be overstroke), but not to the middle of the line-height of the font-height that refers to the space between the "text-top" and "text-bottom" positions ; the font-height excludes:
    • the additional line separation spacing normally divided equally into two line-margins (here 0.5em, according to line-height set to 200%) above and below the font-height).
    • the additional line spacing which may be added by superscripts and subscripts.
  2. However, if the image height causes its top or bottom position to go above or below the normal full line-height of text, the middle position will be adjusted after the increasing the top and/or bottom line-margins so that the image can fit and align properly, and all images (including those with smaller heights) will be vertically centered on the adjusted middle position (for computing the effective line-height, the text of each rendered row with the larger font-height will be considered).
  3. The "text-top" and "text-bottom" alignment positions also excludes the extra line spacing added by superscripts and subscripts, but not the additional line-spacing defined by the line-height.
  4. The "top" and "bottom" alignment positions take into account all these extra line spacings (including superscripts and subscripts, if they are present in a rendered line span). When the image alignment constrains the image to grow above or below the normal line-spacing, and the image is not absolutely positioned, the image will cause the "top" and "bottom" positions to be adjusted (just like superscripts and subscripts), so the effective line-height between rendered lines of text will be higher.
  5. The "underline", "overline" and "overstrike" text-decoration positions should be somewhere within these two limits and may depend on the type and height of fonts used (the superscript and subscript styles may be taken into account in some browsers, but usually these styles are ignored and the position of these decorations may not be adjusted); so these decorations normally don't affect the vertical position of images, relatively to the text.

Link target[edit source]

By default, clicking on an image will take you to the file description page for that image. You can change the link to point to a different page on-wiki, to an external link, or remove the link entirely.

Important
Depending on the licensing requirements of the image you're using, you may or may not be permitted to remove the link to the file description page. If you do so, you may need to provide a link elsewhere on the page to link to the file description page in order to allow access to information required by the license, such as author details, copyright statements, and the history of modifications.

Alt text[edit source]

The alt parameter can be used to specify alt text that will be used by screen readers, or when the image cannot be loaded. You can provide a short description of the image here that someone who cannot see the image can read instead. Alt text does not affect the display of the image to other people.

Galleries[edit source]

Images can be easily grouped together into galleries using the <gallery> tag. The syntax is:

<gallery>
File:file_name.ext|caption|alt=alt language
File:file_name.ext|caption|alt=alt language
{...}
</gallery>

Note that the image code is not enclosed in brackets when enclosed in gallery tags. Link and alt text image parameters can be used in galleries. The File: prefix is optional and can be omitted.

Example:

<gallery>
File:Example.jpg|Item 1
File:Example.jpg|a link to [[Help:Contents]]
File:Example.jpg
File:Example.jpg|alt=An example image. It has flowers
File:Example.jpg|''italic caption''
Example.jpg|on page "{{PAGENAME}}"
File:Using Firefox.pdf|page=72
</gallery>

Renders as:

Gallery parameters[edit source]

The gallery tag itself can take a number of parameters:

<gallery {parameters}>
{images}
</gallery>
  • caption="{caption}": Sets a caption centered atop the gallery. Only plain text may be used in the caption; formatting, templates and the like will not work. If the caption is more than one word, double quotes must be used (e.g. caption="The quick brown fox").
  • widths={width}px: Sets the (max) widths of the images; the default value is 120px. Note the plural: widths.
  • heights={heights}px: Sets the (max) heights of the images; the default value is 120px. Note the plural: heights.
  • perrow={integer}: Sets the number of images per row. If set to 0, the gallery will automatically adjust based on the width of the screen.
  • showfilename={anything}: Shows the filenames of the images in the individual captions for each image.
  • mode={traditional|nolines|packed|packed-hover|packed-overlay|slideshow}: See section below.
  • showthumbnails: For "slideshow" mode only, display the strip with image thumbnails below the slideshow by default.
Mode parameter[edit source]

The mode parameter accepts the following inputs:

  • traditional: The default gallery styling, with border lines and a white box between the images.
  • nolines: Similar to traditional, but with no border lines.
  • packed: Images will have the same height but different widths, with little space between the images. The gallery is responsive and will organize the images according to the width of the screen.
  • packed-overlay: Shows the caption overlaid on the image, in a semi-transparent white box.
  • packed-hover: Similar to packed-overlay, but with the caption and box only showing up on hover.
  • slideshow: Creates a slideshow of the images.

Embedding audio[edit source]

Similar syntax is employed when using audio files.

There is also an option to preset the player to start at a specified time in the track, rather than at the start.

Audio files can be used in galleries, like images.

<gallery>
Accordion chords-01.ogg
Accordion chords-01.ogg|Accordion chords
Accordion chords-01.ogg|start=0:05|According chords
</gallery>

Embedding video[edit source]

Embedding video follows a similar syntax to embedding audio files.

The start and end parameters can be used to have a video start and end at a specified point, in seconds.

The thumbtime parameter can be used to specify the thumbnail shown for the video before it has been played. Give the time as either the number of seconds into the video, or in a HH:MM:SS format. By default, a frame from the midpoint of the video is used as the thumbnail.

Videos can also be embedded inside a gallery.

<gallery>
First flights in aviation history.ogg
First flights in aviation history.ogg|thumbtime=33
Weeding.ogv|start=5|end=7
</gallery>

Linking to a file[edit source]

When you type [[File:Filename]] onto a page, the file will be embedded into the page and be shown to readers. If you want to simply link to the file description page, you will need to prefix the link with a colon. For example, [[:File:Portrait of John Doe.jpg]] will produce a regular wikilink to the file description page for Portrait of John Doe.jpg, rather than embedding the image.

See also[edit source]