I'm building a custom node-property.tpl.php file to display certain CCK fields including imagefields using the Jquery slideshow display. No matter what code I try though, I can't get the slideshow to properly show up. Following CCK documentation (http://drupal.org/node/92382), I've put the following in my custom tpl file:

<?php foreach ($field_property_main_pic as $property_main_pic) { ?>
   <dd> <?php print content_format('field_property_main_pic', $property_main_pic, 'jqs__property_slideshow' ) ?> </dd>
<?php } ?>

"property_main_pic" is the field name and I gleaned that the display name was "jqs__property_slideshow"...where am I doing this wrong?

There's also this documentation (http://drupal.org/node/158667) about theming imagefield fields, but it didn't help either.

Any help is much appreciated!!!

Thank you!

Comments

anniewang’s picture

By the way, what happens with that code is that no images appear at all, and the rest of the tpl file continues outputting correctly.

tomfallowfield’s picture

I struggled with this for a while and ended up 'manually' building the HTML required to display the slideshow:


$image .= "<div class=\"jquery_slideshow\" id=\"jq-slideshow-".$node->nid."-field_images\">";
foreach($node->field_images as $orig){
	$image .= theme('imagecache', 'experience_images', $orig["filepath"]);
}
$image .= "</div>";
print $image;

In my case, "field_images" was the field name and "experience_images" (don't ask) was the preset name.

Hope this helps

lalit774’s picture

<?php
    $output='';
    $node= node_load(9758);
    $jq_slideshow_id = 'jq-slideshow-'. $node->nid .'-field_images';
    $output = '<div class="jquery_slideshow" id="'. $jq_slideshow_id .'">';
    $preset='slideshow';
    foreach ($node->field_images as $image) {
      $output .= theme('imagecache', $preset, $image['filepath'], $image['data']['alt'], $image['data']['title']);        
    }
    $output .= '</div>';
    _jquery_slideshow_get_settings($jq_slideshow_id, $preset);
?>