Placeholders

# General placeholders

They work both inside $dsg_line_pattern and in pagination patterns ($dsg_pagination_pattern variable, as well as in variables of individual pagination components).

# {SELFCLOSE}

It will return ' /' (space + forward slash) if $dsg_xhtml is set to TRUE, otherwise it will return empty string.

Example 
We have 1 image in the default gallery directory (ds_galleries): aaa.jpg.

<?php 
$dsg_line_pattern = "<img src="{THUMB_URL}"{SELFCLOSE}>\n";
include 'dsg.php';
?>
<!-- gives HTML closing tag: -->
<img src="ds_galleries/dynamic_thumbnails/aaa_c80_crop_210_140.jpg">

Example 
We have 1 image in the default gallery directory (ds_galleries): aaa.jpg.

<?php 
$dsg_xhtml = TRUE;
$dsg_line_pattern = "<img src="{THUMB_URL}"{SELFCLOSE}>\n";
include 'dsg.php';
?>
// gives XHTML self closing tag:
<img src="ds_galleries/dynamic_thumbnails/aaa_c80_crop_210_140.jpg" />

# {NEWLINE}

Will output a new line character "\n". It's worth mentioning that it's not exactly the same as using \n because the latter one requires double quotes, whereas the {NEWLINE} works both with double quotes:
$dsg_line_pattern = "{NEWLINE}";
and single quotes:
$dsg_line_pattern = '{NEWLINE}';
Please note that {NEWLINE} outputs a plain text newline, not HTML newline (<br>).

# Counters

# {counter}

Will output current images order number in the images folder. Starts from 1.

1: aaa.jpg
2: bbb.jpg
3: ccc.jpg
4: ddd.jpg
5: eee.jpg
<?php 
$dsg_line_pattern = "{COUNTER}: {ORIGINAL_BASENAME}\n";
include 'dsg.php';
?>

# Placeholders returning values based on original image file properties:

# {ORIGINAL_URL}

Returns URL pointing to original image file. For my_dog.jpg file in pets directory it would return:
pets/my_dog.jpg

# {ORIGINAL_FILENAME}

Returns original image file's file name (without extension). For my_dog.jpg file in pets directory, it would return:
my_dog

# {ORIGINAL_FILENAME_HUMANIZED}

Returns original image file's file name (without extension) but in a more readable version: dashes and underscores converted to spaces, space inserted before every uppercase letter (except the first character in file name) and with all words capitalized. For my_dog.jpg file in pets directory, it would return:
My Dog

# {ORIGINAL_BASENAME}

Returns original image file's full file name including extension. For my_dog.jpg file in petsdirectory, it would return:
my_dog.jpg

# {ORIGINAL_EXT}

Returns original image file's extension. For my_dog.jpg file in pets directory, it would return:
jpg

# {ORIGINAL_WIDTH}

Returns original image file's width in pixels.

# {ORIGINAL_HEIGHT}

Returns original image file's height in pixels.

# Placeholders returning values based on thumbnail file properties:

# {THUMB_URL}

Returns URL pointing to thumbnail image file. Let's assume we have 2 images in the default gallery directory (ds_galleries): aaa.jpg and bbb.jpg

ds_galleries/dynamic_thumbnails/aaa_c80_crop_210_140.jpg
ds_galleries/dynamic_thumbnails/bbb_c80_crop_210_140.jpg
<?php
  $dsg_line_pattern = "{THUMB_URL}\n";
  include 'dsg.php';
?>

# {THUMB_FILENAME}

Returns thumbnail image file's file name (without extension). For my_dog.jpg file in pets directory, it would return:
my_dog_c80_crop_210_140

# {THUMB_BASENAME}

Returns thumbnail image file's full file name including extension. For my_dog.jpg file in pets directory, it would return:
my_dog_c80_crop_210_140.jpg

# {THUMB_EXT}

Returns thumbnail image file's extension. For my_dog.jpg file in pets directory, it would return:
jpg

# {THUMB_BOXWIDTH}

Returns thumbnail image file's target (target box) width in pixels. If thumbnail was created with crop operation (crop is the default operation) it will be equal to {THUMB_WIDTH}, however for thumbnails created using scale operation {THUMB_BOXWIDTH} and {THUMB_WIDTH} can be different. 

Example
We have 3 images in the default gallery directory (ds_galleries):
aaa.jpg (800x600 px - landscape),
bbb.jpg(600x800 px - portrait)
and ccc.jpg (500x500 px - square).

aaa - 100 x 75 (100 x 100 box)
bbb - 75 x 100 (100 x 100 box)
ccc - 100 x 100 (100 x 100 box)
<?php
  $dsg_line_pattern = "{ORIGINAL_FILENAME} - {THUMB_WIDTH} x {THUMB_HEIGHT} ({THUMB_BOXWIDTH} x {THUMB_BOXHEIGHT} box)\n";
  $dsg_thumb_operation = 'scale';
  $dsg_thumb_width = 100;
  $dsg_thumb_height = 100;
?>
<?php include 'dsg.php'; ?>

# {THUMB_BOXHEIGHT}

Returns thumbnail image file's target (target box) height in pixels. For usage example and explanation see {THUMB_BOXWIDTH}

# {THUMB_WIDTH}

Returns thumbnail image file's width in pixels. For usage example see {THUMB_BOXWIDTH}

# {THUMB_HEIGHT}

Returns thumbnail image file's height in pixels. For usage example see {THUMB_BOXWIDTH}

# Placeholders returning values based on preview image file properties:

# {PREVIEW_URL}

Returns URL pointing to preview image file. 

Example
We have 2 images in the default gallery directory (ds_galleries): aaa.jpg and bbb.jpg

ds_galleries/dynamic_previews/aaa_c80_scale_800_700.jpg
ds_galleries/dynamic_previews/bbb_c80_scale_800_700.jpg
<?php
$dsg_line_pattern = "{PREVIEW_URL}\n";
include 'dsg.php';
?>

# {PREVIEW_FILENAME}

Returns preview image's file name (without extension). For my_dog.jpg file in pets directory, it would return:
my_dog_c80_scale_800_700

# {PREVIEW_BASENAME}

Returns preview image's full file name including extension. For my_dog.jpg file in pets directory, it would return:
my_dog_c80_scale_800_700.jpg

# {PREVIEW_EXT}

Returns preview image file's extension. For my_dog.jpg file in pets directory, it would return:
jpg

# {PREVIEW_BOXWIDTH}

Returns preview image file's target (target box) width in pixels. All preview images are created using scale operation, and because of that {PREVIEW_BOXWIDTH} and {PREVIEW_WIDTH} can be different. 

Example
We have 3 images in the default gallery directory (ds_galleries): aaa.jpg (1600x1200 px - landscape), bbb.jpg (1200x1600 px - portrait) and ccc.jpg (1000x1000 px - square).

aaa - 800 x 600 (800 x 800 box)
bbb - 600 x 800 (800 x 800 box)
ccc - 800 x 800 (800 x 800 box)
<?php
  $dsg_line_pattern = "{ORIGINAL_FILENAME} - {PREVIEW_WIDTH} x {PREVIEW_HEIGHT} ({PREVIEW_BOXWIDTH} x {PREVIEW_BOXHEIGHT} box)\n";
  $dsg_preview_width = 800;
  $dsg_preview_height = 800;
  include 'dsg.php';
?>

# {PREVIEW_BOXHEIGHT}

Returns preview image file's target (target box) height in pixels. For usage example and explanation see {PREVIEW_BOXWIDTH}

# {PREVIEW_WIDTH}

Returns preview image file's width in pixels. For usage example see {PREVIEW_BOXWIDTH}

# {PREVIEW_HEIGHT}

Returns preview image file's height in pixels. For usage example see {PREVIEW_BOXWIDTH}

See also

Customizing pagination HTML