Note: You are currently viewing documentation for Moodle 2.5. Up-to-date documentation for the latest stable version of Moodle may be available here: Insert image.

Insert image

From MoodleDocs
Revision as of 12:10, 30 June 2008 by chris collman (talk | contribs) (inserting examples, reordered, still working on it)

This page will assist a new user in mastering the Ed image.gif insert image tool. This tool creates HTML code for the user. The Image Icon on the HTML editor's toolbar brings up this popup window. We should mention here that JPG, GIF and PNG files are recognized Moodle images file types.

Using the insert image tool

Version 1.5.3

Minimum steps

After opening the tool, 2) click on an image file, that puts the address of the file in the Image URL address box at the top of the tool. 3) Next put in some alternative text which will appear when the student moves their mouse over the image.

At this point you have done the minimum and can save your work. You will then return to the page in WYSIWYG HTML edit mode.

File:HTML Insert Image tool. result1.JPG

More things

Before saving, or by clicking on the image and the using the insert image icon, you can do other things to the image with the tool. This includes uploading an image into the course file structure, changing the layout, spacing and resizing the displayed image, as well as some file maintenance.

The sections below will cover each of these operations.

Uploading an image file

These folders and files can also be found in the administration block under files.

  1. The basic steps are to locate the file
    1. Using the File Browser Window for previously uploaded files, OR
    2. Upload a file
      1. Locate and click on the location the file will go to in the File Browser Window
      2. Use Browse button to locate file (local machine)
      3. Use Update button to place file in File Browser Window,
  2. click on file in File Browser Window to place file in "Insert URL"
  3. Enter Alternative Text
  4. Optional Use Layout, spacing and size parameters
  • Best practice is to put all of a single activities images in a folder such as "Lesson Example"
    • It is possible to zip a local folder with images and upload it to a course lesson. See files Click here for more information on files.
    • Remember to use the Refresh feature on your browser if the image does not appear to change in the Moodle Lesson.
The Insert Image pop up tool window =Versions 1.5 to 1.9

When you browse for a local course image file its URL will be inserted like:

 http://www.yourMoodle.net/moodle/file.php/5/courseFolder2/pic1.jpg

Resizing

The width and height of the displayed image can be adjusted by using the resizing tool. It is important to remember to keep the same width to hight proportions, so as not to distort the image.

=Example resizing

The teacher has favorite course image that is placed in every activity. File:Moodle.jpgThis was uploaded once and was 240 pixels wide and 60 pixels high. On the first page of a lesson activity the teacher wants the image to be only 120 pixels wide. Using resizing, the teacher sets the width for 120 and the height at 30. HTML Insert Image tool. result2.JPG

Layout

Alignment and border thickness allow to adjust the image in relation to the line of text and place a border around the image. There is a popup window for alignment HTML toolbar Inser image alignment menu.JPG

Example layout

Here the teacher added a 5 pixel border and aligned the image with the bottom. HTML Insert Image tool. result3.JPG

Spacing

Horizontal and Vertical refers to the area that surrounds the image. Adding pixels of padding around the image moves text away from the image.

Example spacing

Here the teacher added 10 pixels of horizontal spacing to separate the image from the text. HTML Insert Image tool. result5.JPG



Selection

The selection part of the Insert image tool allows the teacher to delete, move, zip,and rename folders and files in a course.

Tips & cautions

Images in page content generally works just fine IF nothing is changed in the actual url address of the file. The famous red x where the image should be indicates something has changed. The first thing to do is to refresh your browser, then click on the image and use the insert picture tool again. Go through the steps again of finding the picture in the file structure in the file browser window.

  • Remember if you change your domain name, your moodle folder name, the image link won't work. In some cases, a backup and restore the course as a new copy or on another server, the link might be broken.
  • If you shorten the URL to:
  1. /moodle/file.php/5/courseFolder2/pic1.jpg it will work even if your domain is changed, but not if restored as new course.
  2. courseFolder2/pic1.jpg it will work even if your course file is backuped and restored as a new course, even on another server.
  • Site file folder linking: (on Moodle 1.8.2 at least)

The URL to files to the frontpage or site folder always contain /1/ like http://www.yourMoodle.net/moodle/file.php/1/siteFolder2/test.jpg Remember anyone with the URL can access files there. Files in a specific course generally are restricted to access only from that course.

A link like: /moodle/file.php/1/siteFolder2/test.jpg will work, and should even work if the site is mirrored on another server (AND the moodle folder name is not changed).

Moral, linking within Moodle is like linking on the internet. Sometimes things change and the teacher is the last to know.