Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have views with multiple cck image fields http://screencast.com/t/UOGxa9Jr6 with 'Group multiple values' And we have a theme function to add the needed classes for a script to display these photos in fancybox

function mytheme_content_view_multiple_field($items, $field, $values) {

    $output = '';
     $i = 0;
    foreach ($items as $item){
      if(!empty($item) || $item == '0')
          if($i == 0) {

            $output .= '<p><a class="" data-fancybox-group="thumb"  href="/' . $item . '"><img src="/' . $item . '" alt="" width="200" height="150" /></a></p>';

          else {
            $output .= '<p><a class="hid" data-fancybox-group="thumb"  href="/' . $item . '"><img src="/' . $item . '" alt="" /></a></p>';
    return $output;    

each node has many images so it takes some time for the nodes to load, you can see each image load one by one taking about 10 seconds to complete

share|improve this question

If you can see the images loading one by one then this doesn't have anything to do with the View rendering slowly.

Slow running PHP generally means you have to wait longer before anything displays, not that individual parts of the page render slowly.

Slow loading images means the file size is large or you have a bad internet connection between you and the server.

You've mentioned that you're using CCK so I assume you're using Drupal 6.

Might I recommend using imagecache to pre-process the images to be scaled on the server to the right dimensions before they are sent to the user.


Instead of printing the image tag directly, setup an imagecache preset in Drupal then you call theme() to generate the image markup.


  print theme('imagecache', 'mypresetname', 'path/to/file.jpg');

Documentation on the theme function can be found here: http://drupalcontrib.org/api/drupal/contributions!imagecache!imagecache.module/function/theme_imagecache/6

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.