Frames & Thumbnails
WikiEducator Tutorials | ||
---|---|---|
Tutorial 6 | Introduction | The Basics | Frames & Thumbnails | Other Media | Show me how | Tips | Summary & FAQs | |
The previous page demonstrated the simplest syntax for adding an image into a page. In this subsection we will cover some additional attributes that you can add to your image syntax to:
|
Contents
Introducing the syntax
In brief, the full syntax for displaying an image is:
[[File:file name|type|location|size|caption]]
Notes:
- type refers to whether you want to display your image as a thumbnail or framed image;
- location allows you to specify where on the page the image should appear, for example: left, right or center
- size allows you to specify the size at which the picture is displayed on the page;
- caption is where you can add a description for your image.
Only [[File:file name]] is actually required. Most images should use [[File:name|thumb|Example image caption]] (and should not specify a size). The other details are optional and can be placed in any order. The following table outlines the optional attributes and their effects on images:
The following table summarises the different options. We practice each of these in separate activities below.
Additional Image Attributes | Results in |
thumb / thumbnail or frame |
Results in an image displayed with specific formatting (see the examples below). |
Location |
'right', 'left', 'center' or 'none'. Determines the placement of the image on the page. Defaults to left. |
Size |
{width}px or {width}x{height}px, will scale the image to the given width and height, while keeping its aspect ratio. |
Caption | Any element that is not identified as any one of the above is assumed to be caption text. |
Examples and activities
Here is an image inserted using the most simple image syntax:
[[File:networkedlearning.jpg]]
The purpose of the following activities is to experiment with different options to manipulate images on the page.
Using the same image, we have now added the 'thumb' attribute, left aligned, and a caption:
[[File:networkedlearning.jpg|thumb|left|Creative Commons makes it flow.]]
The default image size for a thumbnail is 180 pixels. Clicking on the image will take the user to the larger size.
You should have used this syntax: [[File:networkedlearning.jpg|thumb|center|This is my first thumbnail]]. Note that you must use the American spelling for "center".
Inserting an image with a frame
This is an image with the frame attribute:
[[File:networkedlearning.jpg|frame|center|Creative Commons makes it flow.]]
When you use the frame attribute, the embedded image is shown with its actual size enclosed by a frame, regardless of the "thumb" or "size" attribute, and the caption, if any, is visible in the frame. Without the options left, center, and none, the image is normally on the right.
Using the image you uploaded on the previous subsection, go to your Sandbox on your User page and insert a framed image with the following attributes:
|
If you had any problems with this activity, the syntax you should have used is: "[[File:Name_of_your_image_file_goes_here.jpg|frame|left|This is my image. However, if you want to brush up on old Wikieducator news, go [[Old_news|here]].]] ". Did you get it right?
Changing the size of the image
If you want to control the size of the image, you can use the size attribute to designate the desired size in pixels. Here is the same image resized and centered:
[[File:networkedlearning.jpg|300px|center]]
Add the same image (above) to your Sandbox on your user page with the following attributes:
Try adding some further image attributes to the image you previously uploaded into your User page or Sandbox. If the image is large add the thumb attribute to shrink it down. If your image could use some explanatory text try adding the frame attribute and a caption.
|
With regards to the first part of the activity above, you should have used this syntax: [[File:networkedlearning.jpg|350px|right]]