Basic usage

# Include the script in your code

If you already have the dsg.php copied to your main website directory and ds_galleries folder filled with some nice images — you are ready to implement the script. This can be done by one simple line added to your index.php file, in the place where you want the gallery to appear:

<?php include 'dsg.php'; ?>

The line above, is all the PHP coding you need to get the gallery running.

Of course Dead Simple Gallery can do a lot more than that basic default output, you can customize almost every aspect to fit your needs, from things like custom thumb sizes, directories, to more advanced topics like pagination or custom HTML output. Check the side nav for a list of all available topics and feel free to dig in :)

# It creates HTML code for you

The Dead Simple Gallery outputs a list of image thumbnails, each contained within a link pointing to the big version of the image. The default output could look like this:

<li>
  <a href="ds_galleries/dynamic_previews/sunset_c80_scale_800_700.jpg" title="Sunset">
    <img src="ds_galleries/dynamic_thumbnails/sunset_c80_crop_210_140.jpg" width="210" height="140" alt="Sunset">
  </a>
</li>
<li>
  <a href="ds_galleries/dynamic_previews/cat_c80_scale_800_700.jpg" title="Cat">
    <img src="ds_galleries/dynamic_thumbnails/cat_c80_crop_210_140.jpg" width="210" height="140" alt="Cat">
  </a>
</li>
<li>
  <a href="ds_galleries/dynamic_previews/cute_dog_c80_scale_800_700.jpg" title="Cute Dog">
    <img src="ds_galleries/dynamic_thumbnails/cute_dog_c80_crop_210_140.jpg" width="210" height="140" alt="Cute Dog">
  </a>
</li>
...

As you have probably noticed Dead Simple Gallery script does not generate <ul> opening & closing tags, so you need to add them yourself (you can add a class or id to it if you wish):

<ul class="imageList">
  <?php include 'dsg.php'; ?>
</ul>

So your finished index.php file could look like this:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>My gallery</title>
</head>
<body>
  <h1>A pretty gallery</h1>
  <ul class="imageList">
    <?php include 'dsg.php'; ?>
  </ul>
</body>
</html>