Embedding a SimpleViewer gallery in your home page

This example is aimed at people who are already familiar with SimpleViewer and svManager. When svManager creates a new gallery it puts everything into a gallery folder called in this case g1. This is fine for most purposes. However, when you want to embed a gallery in your home page then you need to have an index.html file in the root of your web site – outside the gallery folder. The problem is to make sure that all the links work.

This is just one of the possible ways it can be done. View source in your browser and look in particular at the paths. The key paths are to swfobject.js, viewer.swf and gallery.xml. Note that these paths are relative to the html page that loads the gallery, i.e. the page you are reading now.

Please read the notes below the gallery about how I set it up.

SimpleViewer requires Macromedia Flash. Get Macromedia Flash. If you have Flash installed, click to view gallery.

The default setting in svManager is to create image and thumbnail paths relative to the gallery folder. This can cause problems when the index file is outside the gallery folder. So before I created this gallery in svManager, I changed one of the settings in svManager. In the settings file svmanager/plugins/simpleviewer/settings.php, I changed one line from:

  define('SV_PATH_SCHEME', '');

to the svmanager url on this site:

  define('SV_PATH_SCHEME', 'http://svm1.jhardie.com/svmanager');

Since svManager version 1.5.2, this will change all image paths and thumb paths in the xml file to absolute http links.

Then I just created my gallery in svManager and uploaded some images. After that I created the index.html file that you are looking at now. I didn't change anything inside the gallery g1 folder so svManager shouldn’t have any problems continuing to manage the gallery.

SvManager versions 1.5.1 and earlier

In svManager 1.5.2 and later, the changes to the path scheme will take effect immediately. In older versions of svManager, changing the path scheme will not affect existing galleries, only new ones.

That’s it. If there's anything that’s not clear then please post a question on the SimpleViewer forum.