I find the templates for the Insert module to be invaluable, but I was wondering: is it possible to have an imagecache-insert-image.tpl.php template for any imagecache preset in particular?
For example, I have an ImageCache preset, "Image-With-Caption," which I would like to theme to have the alt text display below the image as a caption. Is this possible with the current version of Insert, or is it in the realm of possibility?
Captions are hard to do by hand for most users of my sites, and the easier I can make it for them, the better.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | insert6_image_template_pattern.patch | 2.64 KB | quicksketch |
| #3 | insert7_image_template_pattern.patch | 2.62 KB | quicksketch |
Comments
Comment #1
quicksketchIt's not currently supported to have per-preset templates (though it could be), so I'll move this to a feature request. For the time being though, you can use IF statements inside of the one imagecache-insert-image.tpl.php file.
Comment #2
geerlingguy commentedI see - thanks for the help! This module's been extremely helpful, and I've started putting it on every Drupal site I develop; there's no better way to manage files/images in most situations.
Comment #3
quicksketchI've committed this patch which enables templating per ImageCache preset (or Image style in Drupal 7). You can now name your templates imagecache-insert-image--[preset-name].tpl.php to target an individual preset. I also updated the README.txt to document this functionality.
Comment #4
geerlingguy commentedVery, very nice. I'll be testing it next week.