My third MODx site is about to launch. It’s relatively simple (no forms!) so I had the chance to really concentrate on refining my architecture, and the work I’ve done will stand me in good stead for a while (unless I give in to the enticements of SilverStripe or ExpressionEngine, or just ditch the PHP altogether and finally get up-and-running with Django).
“Refining his architecture? What does he mean?” For me, learning to use MODx well has been about working out how to combine templates, template variables, chunks and snippets in a logical and efficient structure. A good application – a small one, at least – should have a shape that you can envision (if you’re the kind of person who envisions shapes, that is). The shape should be pleasing, natural and economical. In my first two MODx sites I fashioned a few butt-ugly shapes that would certainly have sullied the pages of Euclid’s Elements.
They worked, and they were clever in their ways, but I feel I’ve moved past all that now, that I’m approaching the gleaming heavenly realm of the Platonic solids, of perfect dodecahedrons and icosahedrons.
Maybe I make it difficult for myself. Two components that are mentioned so often in the MODx forum and documentation that you could be forgiven for assuming were part of the core itself, are the snippets Ditto and Jot – but I’ve never used them. And then there’s Wayfinder. I used it once, and it was great, but I didn’t really know what I was doing and I wasn’t comfortable with it, and it was a hassle to learn how to use it. In the project I’m on now I’ve just done it myself, with a “menu” snippet and a couple of chunks. I know the boundaries of the project so I can decide to avoid complication by battening things down; and there’s so little code that changing it will be easy in the event that the structure of the navigation needs to change in the future.
Incidentally, Jot and Ditto are often mentioned in connection with blogs, for which they appear to be indispensable in MODx. Well, say what you like about WordPress but it does blogging pretty damn well and is equally customizable. I fear if I try putting a blog together with MODx, things might get pretty sticky. Even if I was successful I’d still end up with something far inferior to WordPress. This is a tricky situation, because I really do want to be able to use MODx for blogs – the templating system is close to perfection, and WordPress’s is horrible. But this is all by the way.
I really appreciate the work that people put in to writing freely available, open-source code. Wonders abound. But I have to confess: I don’t have much patience when it comes to using plugins, widgets, modules or whatever. If I’m looking for one it’s to save time, so 1. I want it to behave roughly as I’m expecting, and 2. I want good documentation, i.e. documentation I don’t have to spend much time with. Otherwise, I’d rather just do it myself, gaining into the bargain the extra advantage of avoiding the overhead of features I don’t need.
In this last project I’ve been working on, the most common type of page required an image gallery to go underneath the main content, and a main image in the body of the content text. Any page of this type could have photos added to it, and they should appear in the gallery in the same format. For the solution I needed: an easy way for editors to add photos without any resizing woes; auto-generated thumbnails; a way of outputting the gallery HTML; some good HTML and CSS; and a nice Lightbox on the client-side.
I had a look around for a plugin or module but it really wasn’t worth the hassle and nothing I found seemed like a good fit, so here’s what I did. If anyone spots a problem in the code or in the concept itself, let me know.
UPDATES & THINGS TO NOTE:
- This is about MODx Evolution, not the newer Revolution
- I’m not aiming here to provide full site-wide image management. For that, something like MaxiGallery might be a good choice, and certainly provides loads more features.
- The plugin might not work in the 0.9.x versions of MODx. I’m using 1.0.2. Thanks to Dimmy for pointing this out in the comments
- The plugin doesn’t seem to work correctly when using the front-end editor
- It’s not included here but I’d recommend checking the size of the uploaded photos in the first place, and you might want to actually resize all uploaded images so as to standardize the “full-size” photos that are displayed in the lightbox.
- The code here doesn’t check for the existence of files, or handle exceptions
What we’re aiming for

Above is an example of the page type in question, with the portion of the page we’re interested in highlighted. By the way, the photos are not at all relevant to the website – this is just for illustration.

This is not particularly relevant to the MODx side of things, but for the sake of completion the image above shows the lightbox that pops up when you click on a thumbnail.
To achieve all this we need:
- A template for this kind of page
- Template variables for the photos, to apply to this template
- A chunk for the outer HTML of the gallery: gallery
- A chunk for the inner HTML: gallery_item, to be repeated for each photo
- A snippet for the body photo: body_photo
- A snippet for the gallery: gallery
- A plugin: thumbnailer, which generates thumbnails, and runs when a document is saved
- Some CSS to style the gallery HTML
- Some javascript to display the full-size images in a lightbox – I’ll use jQuery
Although it might make sense to explain the thumbnail generation first, I’m going to start with the template, template variables, snippets and chunks to demonstrate the output we’re aiming to produce, and from there move backwards to the plugin. Finally, with the MODx side dealt with I’ll say a bit about the client-side, specifically the lightbox for viewing the full-size photos.
The Template
The template itself can be whatever you like, just so long as there is one that you can target the template variables to and which you can use for all pages of this type. The relevant portion looks like this:
<h1>[*longtitle*]</h1>
[!body_photo!]
[*content*]
</section>
[!gallery!]
It’s not important that I’m using HTML5 (see the <section> tag). But if you haven’t coded in HTML5 before I heartily recommend it – you can even get it to work in IE with the inclusion of a wee javascript file. This is the first line of an HTML5 document:
Beautiful.
The Template Variables
We need some template variables, one for the main body image and one for each photo in the gallery, and the latter variables need to go in a new category, which I’ve called “Gallery.”

In the editor, this gives you something like this:

You may pick up on a crucial implication of this, namely that the number of photos an editor can add to a page is limited, almost hard-coded. I think this is probably fairly standard practice in the world of CMSs, but it went against my instincts: it’s natural to want to provide the flexibility of being able to add limitless photos. But ultimate flexibility is mostly a complete waste of time, and often holds its own problems. So editors will only be able to add eight photos to a gallery. So what? Looking at the requirements, eight was plenty. To paraphrase 37 Signals in Getting Real, it just didn’t matter. It’s amazing the time you can save by making decisions like this.
Anyway, providing for more photos per page at some point in the future would be a simple matter of the developer/administrator adding more template variables.
The Chunks
We need an outer and an inner chunk.
gallery
<ul>
[+gallery_items+]
</ul>
</section>
gallery_item
<a href="[+big+]" title="[+title+]" rel="lightbox">
<img src="[+thumb+]" alt="[+alt+]" width="[+thumb_width+]" height="[+thumb_height+]" />
</a>
</li>
The Snippets
First of all, some configuration values to be used both by the snippets and by the plugin.
config.php
define('IMAGES_FOLDER','assets/images/');
define('THUMBS_FOLDER','assets/images/thumbs/');
define('MEDIUM_FOLDER','assets/images/medium/');
define('BODY_PHOTO_TMPLVAR','body_photo');
define('THUMB_WIDTH',100);
define('THUMB_HEIGHT',75);
define('BODY_PHOTO_WIDTH',300);
define('BODY_PHOTO_HEIGHT',225);
define('GALLERY_CATEGORY_NAME', 'Gallery');
It’s not very important where this config file lives. Somewhere in “assets” is good. (And if you’re a big fan of config files you could put other things in here, such as the chunk names. Or, now that I think of it, you could pass in the chunk names in the snippet calls.)
The body_photo snippet is pretty basic, and it’s not crucial to do it this way. As usual with snippets I just include a separate file:
body_photo
include_once($modx->config['base_path'].'assets/snippets/body_photo.php');
?>
body_photo.php
include_once($modx->config['base_path'].'assets/bin/utility.php');
include_once($modx->config['base_path'].'assets/bin/config.php');
$medium_folder = $modx->config['site_url'].constant('MEDIUM_FOLDER');
$path = get_tv_value('body_photo',$modx->documentIdentifier);
$html = ''
if(!empty($path)) {
$full_path = $modx->config['base_path'].$path;
$file_name = basename($full_path);
$url = $medium_folder.$file_name;
$size = getimagesize($url);
if($size[0] < $size[1]) { // portrait, so swap the dimensions
$w = $body_photo_width;
$body_photo_width = $body_photo_height;
$body_photo_height = $w;
}
$html = '<img src="'.$url.'" alt="" width="'.$body_photo_width.'" height="'.$body_photo_height.'" />';
}
echo $html;
?>
All this does is echo out an image tag to the page if there’s a value for the body_photo template variable, and nothing if there isn’t. Crucially, though, the image is not the one uploaded but a resized version held in a folder for the medium-sized images. More on the resizing later.
By the way, get_tv_value is just a helper function which I’ve got in utility.php:
global $modx;
$arr = $modx->getTemplateVarOutput($name,$doc_id);
return $arr[$name];
}
Now for the gallery. Again, in the MODx manager we need to just include our snippet code:
gallery
include_once($modx->config['base_path'].'assets/snippets/gallery.php');
?>
gallery.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | <?php include_once($modx->config['base_path'].'assets/bin/config.php'); include_once($modx->config['base_path'].'assets/bin/utility.php'); $html = ''; $images_folder = $modx->config['site_url'].constant('IMAGES_FOLDER'); $thumbs_folder = $modx->config['site_url'].constant('THUMBS_FOLDER'); $gallery_category_name = constant('GALLERY_CATEGORY_NAME'); $thumb_width = constant('THUMB_WIDTH'); $thumb_height = constant('THUMB_HEIGHT'); $gal_vars = $modx->db->select( "name", "modx_site_tmplvars A INNER JOIN modx_categories B ON A.category = B.id ", "B.category = '".$gallery_category_name."'" ); while ($gal_var = $modx->db->getRow($gal_vars)) { $photo = get_tv_value($gal_var['name'],$modx->documentIdentifier); if(!empty($photo)) { $full_path = $modx->config['base_path'].$photo; $file = basename($full_path); $thumb = $thumbs_folder.$file; $big = $images_folder.$file; $chunkArr = array( 'thumb' => $thumb, 'big' => $big, 'title' => $file, 'alt' => $file, 'thumb_width' => $thumb_width, 'thumb_height' => $thumb_height ); $html .= $modx->parseChunk('gallery_item', $chunkArr, '[+', '+]'); } } if(!empty($html)) { $html = $modx->parseChunk('gallery', array('gallery_items'=>$html), '[+', '+]'); } echo $html; ?> |
In gallery.php, line 12 shows why we put the template variables for the gallery in a new category: we can get a MySQL result for the eight variables. Immediately afterwards we loop through that result to build a bunch of list items, each time injecting values into the gallery_item chunk, which is the inner, repeated chunk of the gallery HTML. Each iteration will replace the various placeholders, [+big+], [+title+] and so on, producing something like this:
<a href="http://example.com/assets/images/lochawe.jpg" title="lochawe.jpg" rel="lightbox">
<img src="http://example.com/assets/images/thumbs/lochawe.jpg" alt="lochawe.jpg" width="100" height="75" />
</a>
</li>
Notice that the actual image for the image tag is the thumbnail version, and the surrounding anchor links to the original. Also notice the rel=”lightbox” value, which will be used by the JavaScript.
When we’ve got all the list items it’s time (line 41) to inject them into the outer chunk, gallery, by replacing the placeholder [+gallery_items+]. The end result is something like this:
<ul>
<li>
<a href="http://example.com/assets/images/lochawe.jpg" title="lochawe.jpg" rel="lightbox">
<img src="http://example.com/assets/images/thumbs/lochawe.jpg" alt="lochawe.jpg" width="100" height="75" />
</a>
</li>
<li>
<a href="http://example.com/assets/images/skull.jpg" title="skull.jpg" rel="lightbox">
<img src="http://example.com/assets/images/thumbs/skull.jpg" alt="skull.jpg" width="100" height="75" />
</a>
</li>
<li>
<a href="http://example.com/assets/images/cammo.jpg" title="cammo.jpg" rel="lightbox">
<img src="http://example.com/assets/images/thumbs/cammo.jpg" alt="cammo.jpg" width="100" height="75" />
</a>
</li>
<li>
<a href="http://example.com/assets/images/bavelaw.jpg" title="bavelaw.jpg" rel="lightbox">
<img src="http://example.com/assets/images/thumbs/bavelaw.jpg" alt="bavelaw.jpg" width="100" height="75" />
</a>
</li>
<li>
<a href="http://example.com/assets/images/piano.jpg" title="piano.jpg" rel="lightbox">
<img src="http://example.com/assets/images/thumbs/piano.jpg" alt="piano.jpg" width="100" height="75" />
</a>
</li>
<li>
<a href="http://example.com/assets/images/calton.jpg" title="calton.jpg" rel="lightbox">
<img src="http://example.com/assets/images/thumbs/calton.jpg" alt="calton.jpg" width="100" height="75" />
</a>
</li>
</ul>
</section>
And then it’s echoed out to the page. With all the template parsing done, the HTML that’s sent to the browser will look something like this:
<h1>Corporate Events</h1>
<img src="http://example.com/assets/images/medium/meadows.jpg" alt="" width="300" height="225" />
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed at ante. Mauris eleifend, quam a vulputate dictum, massa quam dapibus leo, eget vulputate orci purus ut lorem. In fringilla mi in ligula. Pellentesque aliquam quam vel dolor. Nunc adipiscing. Sed quam odio, tempus ac, aliquam molestie, varius ac, tellus. Vestibulum ut nulla aliquam risus rutrum interdum. Pellentesque lorem. Curabitur sit amet erat quis risus feugiat viverra. Pellentesque augue justo, sagittis et, lacinia at, venenatis non, arcu. Nunc nec libero. In cursus dictum risus. Etiam tristique nisl a nulla. Ut a orci. Curabitur dolor nunc, egestas at, accumsan at, malesuada nec, magna.</p>
</section>
<section id="gallery">
<ul>
<li>
<a href="http://example.com/assets/images/lochawe.jpg" title="lochawe.jpg" rel="lightbox">
<img src="http://example.com/assets/images/thumbs/lochawe.jpg" alt="lochawe.jpg" width="100" height="75" />
</a>
</li>
<li>
<a href="http://example.com/assets/images/skull.jpg" title="skull.jpg" rel="lightbox">
<img src="http://example.com/assets/images/thumbs/skull.jpg" alt="skull.jpg" width="100" height="75" />
</a>
</li>
<li>
<a href="http://example.com/assets/images/cammo.jpg" title="cammo.jpg" rel="lightbox">
<img src="http://example.com/assets/images/thumbs/cammo.jpg" alt="cammo.jpg" width="100" height="75" />
</a>
</li>
<li>
<a href="http://example.com/assets/images/bavelaw.jpg" title="bavelaw.jpg" rel="lightbox">
<img src="http://example.com/assets/images/thumbs/bavelaw.jpg" alt="bavelaw.jpg" width="100" height="75" />
</a>
</li>
<li>
<a href="http://example.com/assets/images/piano.jpg" title="piano.jpg" rel="lightbox">
<img src="http://example.com/assets/images/thumbs/piano.jpg" alt="piano.jpg" width="100" height="75" />
</a>
</li>
<li>
<a href="http://example.com/assets/images/calton.jpg" title="calton.jpg" rel="lightbox">
<img src="http://example.com/assets/images/thumbs/calton.jpg" alt="calton.jpg" width="100" height="75" />
</a>
</li>
</ul>
</section>
That’s it for the output side of things. But how do we get those thumbnails, and the medium image, where they’re meant to be?
The Plugin
I’ve called the plugin thumbnailer, but it actually does one other thing, which is generate a medium-sized version of the body photo, which is exactly the size required for the page.
As with the snippets I include an external file:
thumbnailer
Notice the lack of PHP opening and closing tags. In plugins, unlike snippets, you always exclude them (and you always forget to.)
The one other thing to do to set up the plugin in the manager is check the OnDocFormSave System Event, as shown below.

thumbnailer.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | <?php include_once($modx->config['base_path'].'assets/bin/ImageHelper.php'); include_once($modx->config['base_path'].'assets/bin/config.php'); $gallery_category_name = constant('GALLERY_CATEGORY_NAME'); // The name of the body photo template variable $body_photo_tmplvar = constant('BODY_PHOTO_TMPLVAR'); // Dimensions $body_photo_width = constant('BODY_PHOTO_WIDTH'); $body_photo_height = constant('BODY_PHOTO_HEIGHT'); $thumb_width = constant('THUMB_WIDTH'); $thumb_height = constant('THUMB_HEIGHT'); // Directory paths $images_folder = $modx->config['base_path'].constant('IMAGES_FOLDER'); $thumbs_folder = $modx->config['base_path'].constant('THUMBS_FOLDER'); $medium_folder = $modx->config['base_path'].constant('MEDIUM_FOLDER'); $gal_vars = $modx->db->select( "A.id", "modx_site_tmplvars A INNER JOIN modx_categories B ON A.category = B.id ", "B.category = '".$gallery_category_name."'" ); // Generate the thumbnails while ($gal_var = $modx->db->getRow($gal_vars)) { $upload_file = $_REQUEST['tv'.$gal_var['id']]; if(!empty($upload_file)) { $full_path = $modx->config['base_path'].$upload_file; $file_name = basename($full_path); ImageHelper::resizeImage($images_folder.$file_name, $thumbs_folder.$file_name, $thumb_width, $thumb_height); } } $body_photo_id = $modx->db->getValue( $modx->db->select( "id", "modx_site_tmplvars","name = '".$body_photo_tmplvar."'" ) ); // Also create the medium-sized image $upload_file = $_REQUEST['tv'.$body_photo_id]; if(!empty($upload_file)) { $full_path = $modx->config['base_path'].$upload_file; $file_name = basename($full_path); // Swap the dimensions if it's portrait if(ImageHelper::isPotrait($images_folder.$file_name)) { $w = $body_photo_width; $body_photo_width = $body_photo_height; $body_photo_height = $w; } ImageHelper::resizeImage($images_folder.$file_name, $medium_folder.$file_name, $body_photo_width, $body_photo_height); } ?> |
My first instinct when writing this was to use the MODx API to get the template variable values, but when the plugin runs it’s too early to do that, so we have to use $_REQUEST to get the form values directly from the editor. The naming scheme for template variable input elements is “tv[template variable id],” e.g. in my case it was tv9 to tv17 for the gallery variables.
For the thumbnails, we can get the same MySQL result that we used for the snippet (line 21), and then in the loop, concatenate the input name using the template variable IDs (line 28). For the body photo, we can get the name for the input by first getting the ID of the body_photo template variable based on its name (line 37).
For the resizing itself, I’ve used a small class called ImageHelper, which is kindly provided here at Tips for Twits. I’ll include the code here for completeness:
ImageHelper.php
class ImageHelper {
static function treatFilename($filename) {
$newfilename = strtolower($filename);
$newfilename = str_replace(" ","_",$newfilename);
return $newfilename;
}
static function isPotrait($srcimage) {
if (!file_exists(realpath($srcimage)))
return;
return !ImageHelper::isLandscape($srcimage);
}
static function isLandscape($srcimage) {
if (!file_exists(realpath($srcimage)))
return;
$size = getimagesize( $srcimage );
return ($size[0] > $size[1]);
}
static function resizeImage($srcimage, $destimage, $width, $height) {
//if (!file_exists(realpath($srcimage)))
//return;
$srcpathinfo = pathinfo($srcimage);
$srcext = strtolower($srcpathinfo['extension']);
$destpathinfo = pathinfo($destimage);
$destext = strtolower($destpathinfo['extension']);
$size = getimagesize( $srcimage ); // Get the size of the original image into an array [0]=> width, [1]=> height
$image = null;
$canvas = imagecreatetruecolor( $width, $height ); // Prepare canvas
// Create a new image in the memory from the file
switch ($srcext) {
case 'wbmp':
case 'bmp':
$image = imagecreatefromwbmp($srcimage);
break;
case 'jpg':
case 'jpeg':
$image = imagecreatefromjpeg($srcimage);
break;
case 'png':
$image = imagecreatefrompng($srcimage);
break;
case 'gif':
$image = imagecreatefromgif($srcimage);
break;
case 'xpm':
$image = imagecreatefromxpm($srcimage);
break;
default:
return;
}
// Calculate dimensions
$widthratio = $size[0]/$width;
$heightratio = $size[1]/$height;
$dimensions = array(
'ratio' => $widthratio,
'source_cropwidth' => 0,
'source_cropheight' => 0,
'source_offsetx' => 0,
'source_offsety' => 0
);
if ($heightratio < $widthratio)
$dimensions['ratio'] = $heightratio;
$dimensions['source_width'] = $size[0];
$dimensions['source_height'] = $size[1];
$dimensions['source_cropwidth'] = $width * $dimensions['ratio'];
$dimensions['source_cropheight'] = $height * $dimensions['ratio'];
$dimensions['source_offsetx'] = ($size[0] - $dimensions['source_cropwidth']) / 2;
$dimensions['source_offsety'] = ($size[1] - $dimensions['source_cropheight']) / 2;
imagecopyresampled($canvas, $image, 0, 0, $dimensions['source_offsetx'], $dimensions['source_offsety'], $width, $height, $dimensions['source_cropwidth'], $dimensions['source_cropheight']);
switch ($destext) {
case 'jpg':
case 'jpeg':
imagejpeg( $canvas, $destimage );
break;
case 'png':
imagepng( $canvas, $destimage );
break;
case 'gif':
imagegif( $canvas, $destimage );
break;
case 'wbmp':
case 'bmp':
imagewbmp( $canvas, $destimage );
break;
}
imagedestroy( $canvas );
imagedestroy( $image );
return true;
}
}
It takes care of cropping and resizing very nicely, and is the simplest and most effective code for this kind of circumstance that I’ve found.
So let’s say an editor has their document looking like this:

In the file system, the result of saving this document will be the following (with all other files excluded).

Client-Side
It’s a simple job to style the HTML output with CSS, so I won’t cover that. So, let’s briefly cover the lightbox. First it needs some CSS like this:
#lightbox-panel {left:0;right:0;display:none;position:fixed;top:100px;background:transparent;z-index:1001;text-align:center;}
#lightbox-panel a {color:#FEF9EB}
Recall that in the gallery each list item’s image link has rel=”lightbox”. We can use this in following code, which, aside from its dependence on jquery, is the entirety of the lightbox script (it doesn’t work in IE6 though, last time I checked – some tweaking required for that).
$("a[rel^='lightbox']").click(function() {
if($("#lightbox-panel").length===0) {
var lightbox = '<div id="lightbox-panel">\
<img src="'+ $(this).attr('href') +'" alt="photo" /><br />\
<a id="close-panel" href="[~[*id*]~]#">Click anywhere or press Escape to close the image</a>\
</div>\
<div id="lightbox"></div>';
$(lightbox).appendTo('body');
}
else {
$("#lightbox-panel img").attr('src',$(this).attr('href'));
}
$("#lightbox, #lightbox-panel").fadeIn(300);
$("#lightbox-panel img").show();
return false;
});
$("a#close-panel").live('click', function() {
$("#lightbox, #lightbox-panel").fadeOut(300);
return false;
});
$("body").live('click', function() {
$("#lightbox, #lightbox-panel").fadeOut(300);
});
$(this).keydown(function(e) {
if(e.keyCode===27) { //Escape
$("#lightbox, #lightbox-panel").fadeOut(300);
}
});
}); // DOM ready
Click on the photo below for a demo.
So there you have it. I hope you find it shapely, pleasingly simple, and easy to maintain.

Great post, really useful solution for a common problem. Keep up the good work!
Nice work!
one small thing that this only works on evo from 1.x because in the 09x versions the tv names are the actual names you give them (in the plugin) so this: $upload_file = $_REQUEST['tv'.$gal_var['id']]; would not work in older versions.
Dimmy
Danny and Dimmy: thanks.
I’ve updated the post to point out the MODx version.
Thanx alot! ….How ever, I don’t get the resizing of the body_image to work the way I want. The ImageHelper.php seems to beable to do a resizing with correct aspect ratio but then crops it to 300*225 (if landscape). But if I dont want it to have the same aspect ratio on all images, is it possible to instead have a ‘maximum’ size, lets say 300px, on either aspect instead?
all the best.
marcus
Hi Marcus
Maybe instead of using the constants in config.php you could calculate the desired dimensions on the basis of the original ones by dividing both dimensions by your scale factor, whatever it might be. You could also incorporate a maximum into that calculation, probably.
Then you can pass those calculated dimensions to ImageHelper::resizeImage.
Does that make sense?
In your story above, you named utility.php, where can i find file.
Hi Guido
utility.php is just a file that I created. It contains various helper functions – which I also created – such as get_tv_value, which is shown above. It’s just my way of getting the TV value.
Hi Alistair, I am looking for a way to create thumbs with the same size (for example all thumb squared), no matter if the original image is vertical or horizontal. Because the tutorial is quite long, can you tell me if this is the case?
Thanks
Hi microcipcip, yes, that’s what this solution does, using THUMB_WIDTH and THUMB_HEIGHT.
I can’t get it working =/…
I followed everything step by step, I have my page fully finished. Now i want to implement the gallery. Can i implement it in the ModX Backend ? And how do i call it.
If i just paste the
[!body_photo!]
[!gallery!]
Into my content a white page turns up.
Moreover i dont know what to put in the tv’s that i created, and they dont show up under the template !