The $ThumbList['_tmpl'] array contains all HTML snippets used to build the thumblists. You can change them by predefining them in your config.php, before including the thumblist2.php script, for example:

$ThumbList['_tmpl']['awrap'] = "<a href='?L' target='_blank' %2\$s>%1\$s</a> "; in order to force all links to the originals to open in new browser windows.

Here are the entries of the array that you can redefine and the parameters (indicated as %s in the snippet) that the script is expecting:

  • $ThumbList['_tmpl']['imgwrap'] : the <img/> tag for the inclusion of the thumbnail. Parameters: 1. Title attribute; 2. Alt attribute (defaults to 1.)
  • $ThumbList['_tmpl']['awrap'] : the <a href> link around the thumbnail. Parameters: 1. the picture <img/> tag; 2. additional html parameters, notably the rel= parameter (defaults to nothing).
  • $ThumbList['_tmpl']['captionwrap'] : the HTML around the thumbnail captions, when there are defined. Parameter: 1. the caption text.
  • $ThumbList['_tmpl']['cellwrap'] : the <td> table cell for table mode thumblists. Parameters: 1. the linked thumbnail; 2. the thumbnail caption; 3. eventual additional attributes for the <td> tag; 4. eventual additional attributes for the <div> tag around the thumbnail.
  • $ThumbList['_tmpl']['inlinewrap'] : the HTML code around single thumbnails in the "inline" mode (no tables). Parameters: 1. the linked thumbnail; 2. the thumbnail caption if exists.
  • $ThumbList['_tmpl']['inlinewrapall'] : the HTML code around the whole inline thumblist (inserted as parameter 1).
  • $ThumbList['_tmpl']['rowwrap'] : the HTML code around the thumbnail table cells in one row. Parameter: 1. the joined cells.
  • $ThumbList['_tmpl']['tablewrap'] : the <table> HTML code around the table rows. Parameters: 1. table attributes; 2. eventual table caption; 3. the table body made of the joined rows.

Look at the code. You can use all available "Question variables" which will be replaced at runtime.

This is somewhat an advanced PHP string parsing, make sure you understand how the current definitions are done in the script and how the php function sprintf works.

For example, to use the very advanced, CSS formatted <div>Picture<div>Caption</div></div> display in inline lists, set this in config.php:

$ThumbList['_tmpl']['captionwrap'] = '<div class="caption">%s</div>';
$ThumbList['_tmpl']['inlinewrap']  = '<div class="thumbdiv">%s%s</div>';
$ThumbList['_tmpl']['inlinewrapall'] = '%s'; 

Note that you should neither have leading space(s), nor new lines in your snippets, unless you know what you're doing.