Skip to main content

History: Help - Images

Source of version: 77

Copy to clipboard
            {BOX(class="Layout_box6",width="100%")}{CUT(colsize=5%|70%)}{img fileId="1752"}---{DIV(class="bigBold")}An Image is worth a thousand words{DIV}
Here's how you add images to a page, and style them.{CUT}{BOX}
{maketoc}
----
!Introduction
Even though it's easy to upload and display images in Tiki, it can be confusing because:
* Images are referred to by their fileId, not their name
* Two different syntaxes for images exist: IMG and '''img'''
* The File Gallery interface is powerful, but requires you to know how it works.
However, if you follow some simple rules, putting images on your wiki pages will become easy.

!Adding Images
Click the image gallery icon {IMG(src="pics/icons/pictures.png")}{IMG} on the toolbar to choose or upload images.
{img fileId="1762"}
What to do next depends on whether you want to upload a new image or insert an existing image.

!!Add A New Image
If you want to upload a new image, click the '''Advanced Mode''' button in the dialogue first.
While you ''can'' upload from the basic interface, it is recommended to use the Advanced Mode interface instead because there you can choose in which file gallery to put the uploaded image(s).
If none of the existing files galleries suits you, you can {ALINK(aname="Creating a File Gallery")}create your own file gallery{ALINK}.
{img fileId="1751"}
The Advanced Mode interface allows you to set a title, description and choose which file gallery to put the uploaded image into.
The last bit is important, because we have over 1000 images currently, and it would be nice to be able to find those uploaded images easily.
Not only for image reuse, but also for __''updating''__ those images.
The Advanced Interface allows allows you to add more images before uploading, which is quite handy:
Simply click '''Add File''' instead of '''Upload''' to add another image.
{SPLIT()}{img fileId="1748" thumb="mouseover" width="300"}---{img fileId="1747" thumb="mouseover" width="300"}{SPLIT}
{TRANSCLUDE(page="dobox")}Use Advanced Mode to upload __all__ your images in one go!
If you upload images one by one, you have to save the page between each image insert due to what appears a bug, but it's also faster to upload all your images for a page in one operation.{TRANSCLUDE}

After you've done uploading, you can insert the image into your wiki page by clicking the insertion link.

You should see something like this:
{CODE()}{img fileId="1683" thumb="y" alt="" rel="box[g]"}{CODE}

---
!!Working With Images
By default, images are thumbnails and uses the ColorBox effect when clicking them.
The newly inserted image looks like this:
{img fileId="1683" thumb="y" alt="" rel="box[g]"}

Most of the time, this is what you want, although the default size of the image is a bit too small for most uses.
So all you have to do, is put in a '''width''' parameter:
{CODE()}{img fileId="1683" thumb="y" alt="" rel="box[g]" width="300"}{CODE}
And your thumbnail is ready:
{img fileId="1683" thumb="y" alt="" rel="box[g]" width="300"}
If you want the image to float, set the '''imalign''' parameter to either '''right''' or '''left''':
{CODE()}{img fileId="1683" thumb="y" alt="" rel="box[g]" width="300" imalign="right"}{CODE}
{img fileId="1683" thumb="y" alt="" rel="box[g]" width="300" imalign="right"}
And now your image will be floating to the right.

However, sometimes you don't want a thumbnail, so you just remove it:
{CODE()}{img fileId="1683"}{CODE}
And your image will show as-is.

Looking at the floating image to the right here, you probably notice that there is no padding around the image.
%clear%
{img fileId="1683" thumb="y" alt="" rel="box[g]" width="300" imalign="right" class="padded"}
You can fix that easily by using the '''{ALINK(aname="padded",pagename="Wiki Styles")}padded{ALINK}''' class:
{CODE(wrap="1")}{img fileId="1683" thumb="y" alt="" rel="box[g]" width="300" imalign="right" class="padded"}{CODE}
And you should see some padding around the image.

If you want to adjust the properties of an image, you can use the image button {IMG(src="pics/icons/picture.png")}{IMG} on the toolbar:
select the image tag and use the image tag editor to set its properties.
%clear%
{TRANSCLUDE(page="warndiv")}Use '''imalign''' when aligning images, '''align''' to align images in a style box ('''stylebox="border"'''){TRANSCLUDE}

{TRANSCLUDE(page="infobox")}There is two different image plugin syntaxes:
{CODE()}{img parameter parameter}{CODE}
{CODE()}{IMG(parameter, parameter)}{IMG}{CODE}
It's mostly the same, except that the first one is lowercase '''img''', doesn't use parentheses around the parameters, allows the arguments to be separated by space instead of commas, and doesn't have an '''ending'''-tag.
Clicking the image button {IMG(src="pics/icons/picture.png")}{IMG} will convert the former syntax into the latter.
{TRANSCLUDE}

---
!!Insert An Existing Image
In the upload dialogue, click '''Browse Gallery'''.
You are now taken to the File Gallery page where you can find existing images.
{img fileId="1763" thumb="y" alt="" rel="box[g]" width="300" imalign="left" class="padded"}
A good idea to check '''keep gallery window open''' if you're planning to insert multiple images.

By clicking the wrench icon you can perform operations on the individual images, like '''Display''', '''Replace''', etc.

You can also click the '''Browse Images''' button if you want.

For more on the File Gallery, see {ALINK(aname="File Gallery")}below{ALINK}.
%clear%
---
!Image Syntax
{CODE(caption="Image Example Syntax",wrap="1")}{img fileId= , height= , width= , max= , link= , thumb=, rel=, class= , imalign= , stylebox= , desc= , title=}{CODE}
|| {MONO()}fileId{MONO} | The File Gallery Id
{MONO()}height{MONO} | sets the height of the image
{MONO()}width{MONO} | sets the width of the image
{MONO()}max{MONO} | set this to maintain aspect ratio: it takes the largest value of width/height%%%and sets that to '''max'''
{MONO()}link{MONO} | name of wiki page to link to (without parentheses) or external link
{MONO()}thumb{MONO} | set to '''y''' to turn image into a thumbnail
{MONO()}rel{MONO} | set to '''box''' or '''box[[g]''' to show image in ColorBox when clicking a thumbnail
{MONO()}class{MONO} | set to CSS class to style the image tag. (See ((Wiki Styles)) )
{MONO()}imalign{MONO} | '''left''' or '''right''' - floats the image
{MONO()}stylebox{MONO} | set to '''border''' to make a border around the image
{MONO()}desc{MONO} | text to be shown underneath the image (or in Colorbox popups)
{MONO()}title{MONO} | text to be shown as title popup upon mouse over ||
Visit tikiwiki.org for the full list of available parameters.

{TRANSCLUDE(page="seebox")}[http://doc.tikiwiki.org/Wiki-Syntax+Images]
[http://doc.tikiwiki.org/PluginImg]{TRANSCLUDE}

---
!The File Gallery
The File Gallery is a very powerful tool. (:smile:)

You can browse, move and replace images and create file galleries.

!!Browsing Images
When viewing the file gallery, you can switch to image browse mode by clicking the '''Browse Images''' button.

Here's how the {MONO()}Community -> Wiki Help - Images{MONO} gallery looked like when this wiki page was written:

{img fileId="1746" thumb="y" alt="" rel="box[g]" width="300"}

Notice how all the images for this page are neatly tucked away in a gallery of their own.

---
!!Creating a File Gallery
To create a File Gallery, click the '''Create A File Gallery''' button in the Gallery Browser:

{img fileId="1742" thumb="y" alt="" rel="box[g]" width="300"}

In the Create Gallery screen, give the gallery a descriptive name:

{img fileId="1741" thumb="y" alt="" rel="box[g]" width="300"}

{TRANSCLUDE(page="warndiv")}Make sure that you set the gallery to __'''public'''__!
Otherwise no one is able to use it (but you).{TRANSCLUDE}

The gallery will be created as a child of the gallery you're in.

So if you want to add a gallery under '''Icons''', stand in the icons gallery when creating it.

---
!!Moving images and galleries
The File Gallery interface allows you to move images (files) and galleries around.

To move images and/or galleries, select them in the explorer.
You can hover your mouse over the '''backlinks''' link to see what page they're used in.

{img fileId="1744"}

Once selected, click the '''move''' icon in the action toolbar, and when the page has refreshed, select what gallery to move to:

{img fileId="1743"}

---
!!Replacing Images
It happens frequently: you've uploaded some images, and now they're already obsolete and needs to be replaced.

You could just upload a new image, and then update the links to it, but there's a better way!

Click '''replace''' in the wrench icon dialogue:

{img fileId="1745" thumb="y" alt="" rel="box[g]" width="300"}

You can now upload a new version of the image.

And, like magic: each occurrence of that image is replaced by the new one.

{TRANSCLUDE(page="infodiv")}__Q:__ I've just replaced an image, and nothing happens! (:surprised:)

__A:__ The image __''has''__ been replaced, of course.
But you can't see it due to the wiki pages being cached (for performance reasons).

Either wait for the cache to clear, or clear the cache from the Admin menu (if you have the permission to do so) and you should see that the image indeed has been replaced.{TRANSCLUDE}

{TRANSCLUDE(page="dobox")}Use Image Replace to update existing images to a new version!{TRANSCLUDE}

---
!Good Practices
!!Use File Galleries
Put your images in file galleries according to their scope.

For instance, if you're uploading an image for an article in the '''Cookbook - Snippets''' section, put the image into the '''Cookbook - Snippets''' gallery.

If you're using more than one image, consider making a child gallery under '''Cookbook - Snippets''' with the name as your wiki page to hold all wiki images for that page.

It makes it easy to find the images later on.
And update them when that time comes.

Icons and other common elements, which are meant to be reused, are not going to be reused if they cannot be found!

So take some time when uploading your images and save a lot of time later. (:smile:)

!!Image Sizes
Choosing the right size for your images is important for good looks.
Here's some recommendations.
!!!Thumbnails
When creating images like screenshots, etc. to be used as thumbnails, scale them down to 80% of original size, before uploading them.
The rest of the down-scaling will be done by the thumb-nailing code.
!!!Icons
Due to a bug in the way Tiki handles transparent PNG icon images, you need to upload them pre-scaled.
The problem becomes obvious when using the '''width''' or '''height''' parameters on a png image with transparency:
{img fileId="1736" width="40"}
As you can see, the transparent part of the image is not handled properly..
Without setting the '''width''' parameter, it shows correctly:
{img fileId="1736"}

It doesn't happen when using gif's.
But png looks better.

Common sizes are: 128px, 64px and 48px.

Name them according to their size, i.e. '''ogrehead-48.png''', etc.

And be sure to upload them to the '''Icons''' File Gallery! (:smile:)

---
!Neat Tricks
Some good tips which you might find handy. (:smile:)

!!Floating Screenshots
__The Problem:__
If you're trying to create a page with two or three screenshots floated to the right, you'll probably have a very hard time trying to make them float on top of each other, instead of halfway side by side:
{CODE(wrap="1")}{img fileId="1734" align="right" stylebox="border"}
{img fileId="1734" align="right" stylebox="border"}{CODE}
{img fileId="1734" align="right" stylebox="border"}
{img fileId="1734" align="right" stylebox="border"}
The problem is obvious, but the solution is not so obvious!

__The Solution:__
Use the class '''clearRight''':
{CODE(wrap="1")}{img fileId="1734" imalign="right" class="clearRight"}
{img fileId="1734" imalign="right" class="clearRight"}{CODE}
If using '''stylebox="border"''' you need to use a DIV around the images instead (and '''align''' instead of '''imalign'''):
{CODE(wrap="1")}{DIV(class="clearRight")}{img fileId="1734" align="right" stylebox="border"}
{img fileId="1734" align="right" stylebox="border"}{DIV}{CODE}
{DIV(class="clearRight")}{img fileId="1734" stylebox="border"}
{img fileId="1734" stylebox="border"}{DIV}

And your images are neatly aligned to the right! (:biggrin:)

        

History

Information Version
Tue 17 of Jan, 2012 00:11 GMT-0000 Beauty upstyled an important note 85
Sun 21 of Aug, 2011 18:56 GMT-0000 Beauty added screenshots for screenshot code examples + tiny corrections 84
Sun 21 of Aug, 2011 18:19 GMT-0000 Beauty improved section "Application Screenshots" 83
Sun 21 of Aug, 2011 17:50 GMT-0000 Beauty added example for horizontally aligned images with description box and web2.0 style 82
Sun 20 of Feb, 2011 21:41 GMT-0000 Beauty added a note for "box[g]" option 81
Wed 12 of Jan, 2011 11:30 GMT-0000 Beauty improved: application screenshots 80
Wed 12 of Jan, 2011 11:24 GMT-0000 Beauty improved code for screenshot thumbnails (better display style for full size) 79
Wed 12 of Jan, 2011 11:19 GMT-0000 Beauty added section for applications screenshots + modified note for multiple image display, because the old code had problems with Internet Explorer (when you apply some more options -- see pictures on Gl 78
Wed 09 of Jun, 2010 14:45 GMT-0000 jacmoe 77
Sat 05 of Jun, 2010 14:16 GMT-0000 jacmoe 76
Fri 04 of Jun, 2010 14:26 GMT-0000 jacmoe 75
Tue 01 of Jun, 2010 13:02 GMT-0000 jacmoe 74
Tue 01 of Jun, 2010 09:43 GMT-0000 jacmoe 73
Tue 01 of Jun, 2010 09:42 GMT-0000 jacmoe 72
Tue 01 of Jun, 2010 09:41 GMT-0000 jacmoe 71
Tue 01 of Jun, 2010 09:38 GMT-0000 jacmoe 70
Tue 01 of Jun, 2010 09:16 GMT-0000 jacmoe 69
Tue 01 of Jun, 2010 09:02 GMT-0000 jacmoe 68
Tue 01 of Jun, 2010 09:01 GMT-0000 jacmoe 67
Tue 01 of Jun, 2010 08:59 GMT-0000 jacmoe 66
Tue 01 of Jun, 2010 08:58 GMT-0000 jacmoe 65
Tue 01 of Jun, 2010 08:55 GMT-0000 jacmoe 64
Tue 01 of Jun, 2010 08:54 GMT-0000 jacmoe 63
Tue 01 of Jun, 2010 08:53 GMT-0000 jacmoe 62
Tue 01 of Jun, 2010 08:52 GMT-0000 jacmoe 61