Tutorial #4: Images
Let’s add an image to the test page we created earlier.
Creating an image asset
- Log into the CMS and click on the “Images” tab. Here you will see a list of images that have been already added by other people. The list is long, but we’ll show you how to keep it organized in a minute.
- At the bottom of the page, click on “New Asset”. An “asset” can be any file, but in this case we will add an image.
- Give the image a meaningful title.
- Click on the “more” link.
- Give the image a meaningful caption. This caption can be automatically added to your content later.
- Add two tags to your image by entering “tutorial, test image” into the tags field. Tags are used to organize your images.
- Select an image file from your computer that you would like to upload into the system by clicking the “Browse” button.
- Click on “Create Asset” to upload the file.
Adding images to pages
After you create the image, it will take you back to the images tab.
- Click on the “tutorial” link in the “tags” column next to the image you just created. This filters the list of images by only those who have that same tag. You can create any tag to help yourself organize your images. For example, if you use your name as a tag, then you can keep track of all the images you have uploaded. This will save you from hunting through the list of images.
- Next to your image, click on “Add to Bucket”. The “Bucket” is a place for holding images you are currently working with. Again, this helps keep the list of images you are interested in down to a reasonable number. When you click on “Add to Bucket” the image appears in the bucket area at the bottom of the page.
- Right-click (Ctrl-click on a Mac) on the image in the bucket at the bottom of the page, and choose “Copy Link Location” or the equivalent for your browser.
- Now click on the “Pages” tab of the CMS.
- Navigate to your test page, and click on it to edit it.
- In your test page, type two exclamation points, ”!!” and paste the image link location between them, so that it looks something like the following: !http://152.16.15.129/assets/123/myPhoto.jpg!
- Click “Save and continue editing”
- View your page in a browser as you did before. The image should now appear on your page.
The tutorial on page layouts will explain how to put the image in a specific area on the page.
Advanced image topics
You can use Radiant tags to add images that will automatically be resized or “thumbnailed”. To begin with, you will need to use a different scheme to add your image.
Creating an image thumbnail
- Click on the “Images” tab in the CMS
- Click on your test image title in the list. This will take you to a page with the image on it.
- The filename is shown above the image. Copy this.
- Let’s say the image file name is “myPicture.jpg”. In your test page, create a tag like the following, using your image file name:
<r:asset:image name="myPicture.jpg" size="thumbnail"/>
- Now save and continue editing.
- View your test page. It should have a thumbnail of your image on it.
You can also use the size=”icon” for an even smaller version of the image.
Using the image title or caption
To use the image title or caption in your content, copy the following into your test page, and replace the “myPicture.jpg” with your image file name. You can put any
text or formatting around the title and caption tags.
<r:asset name=”myPicture.jpg”/>
<r:image size="thumbnail"/>
<r:title/>
<r:caption/>
</r:asset>
For a more advanced example of this usage, see the “staff” page in the CMS.
|