Image teasers are a bit odd... the $item->teaser built for display in placemark popups do not include the actual thumb, even though by default thumbnails are shown in teasers around a Drupal site. This must be because the theming of image nodes looks after this some how.
By the same token one could probably make a theme function to do this for the kml_placemark_description type. However, a simple way to include thumbs from image nodes is to have the kml_format_placemark function do this for us.
Just a few lines need to be added in that function as shown here:
function kml_format_placemark($item, $link, $alt = 0, $args = array()) {
$title = $item->title;
$description = $item->teaser;
/* Special case for images */
if ($item->type == 'image') {
$description = $item->content['image']['#value'] . $description;
}
I don't really agree with this module needing to treat images in a special way, but unless the image module is modified to include thumbs in the $item->teaser is there another way?
Comments
Comment #1
raintonr commentedAhhhhh... a better fix for this would be something more generic that allowed more control via the theme functions.
If one changed the
theme_kml_placemark_descriptionfunction so that instead of taking the raw text description, one passed the whole node object things would be a lot more flexible.Default code would become:
At first glance this doesn't seem particularly useful, but it allows one to place a function like this in their
template.phpfile:Comment #2
raintonr commentedHere's a patch file. It's been tested with the latest KML.module (5.x-1.x-dev (2007-Nov-20))
I'm really keen to see this incorporated into the base code. It's such a simple change but allows a lot of flexibility.
Particularly nice when combined with #82725: Allow for icons in GE to be altered (per c.type).
Thanks.
Comment #3
raintonr commentedPatch now committed to cvs.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.