To start I would like to say this is my first support post for any product. I am usually very good at figuring out a problem myself of finding the information on the internet.

That said, I am having a world of trouble attempting to get (Advanced) DDBlock to work on my website. I have followed the detailed instructions on the DDBlock page, as well as the video to make the Advanced DDBlock work as it should, however the result is always a gray box with a title and no images or text.

I am currently running using the following:
- I am using the admire_gray theme in the sites/all/themes directory
- My modules are all in the /modules directory (not sites/all) <--- if this is the issue, is there a way to safely migrate my modules to sites/all/modules?
- I have followed the instructions on the web to a T, including instructions relating to export_files and upright10-50
- My most recent install attempt is a replica of the Advanced DDBlock video
- I am using the views and news item exports
- I have tried to change my template.php to match the result of drupal_set_message
- I have tried clearing my cache
- I have allowed myself all permissions
- I am using the most recent version of Views

I should mention that I was able to get DDBlock to work simply rotating images from a folder at one time, but my goal is to have recent news content rotated with a large image/description/link-to-content and thumbnails of the next 5 slides.

If there is any other information you need from me, I will be happy to do get it to you immediately.

Any help is greatly appreciated!

(here is the code for template.php - I have also attached it in a text file)

<?php 
function phptemplate_body_class($sidebar_left, $sidebar_right) {
  if ($sidebar_left != '' && $sidebar_right != '') {
    $class = 'sidebars';
  }
  else {
    if ($sidebar_left != '') {
      $class = 'sidebar-left';
    }
    if ($sidebar_right != '') {
      $class = 'sidebar-right';
    }
  }

  if (isset($class)) {
    print ' class="'. $class .'"';
  }
}
/*!
 * Dynamic display block preprocess functions
 * Copyright (c) 2008 - 2009 P. Blaauw All rights reserved.
 * Version 1.6 (01-OCT-2009)
 * Licenced under GPL license
 * http://www.gnu.org/licenses/gpl.html
 */

 /**
 * Override or insert variables into the ddblock_cycle_block_content templates.
 *   Used to convert variables from view_fields to slider_items template variables
 *
 * @param $vars
 *   An array of variables to pass to the theme template.
 * 
 */
function admire_gray_preprocess_ddblock_cycle_block_content(&$vars) {
  if ($vars['output_type'] == 'view_fields') {
    $content = array();
    // Add slider_items for the template 
    // If you use the devel module uncomment the following line to see the theme variables
    // dsm($vars['settings']['view_name']);  
    // dsm($vars['content'][0]);
    // If you don't use the devel module uncomment the following line to see the theme variables
    // drupal_set_message('<pre>' . var_export($vars['settings']['view_name'], true) . '</pre>');
    // drupal_set_message('<pre>' . var_export($vars['content'][0], true) . '</pre>');
    if ($vars['settings']['view_name'] == 'news_items') {
      if (!empty($vars['content'])) {
        foreach ($vars['content'] as $key1 => $result) {
          // add slide_image variable 
          if (isset($result->node_data_field_image_field_image_fid)) {
            // get image id
            $fid = $result->node_data_field_image_field_image_fid;
            // get path to image
            $filepath = db_result(db_query("SELECT filepath FROM {files} WHERE fid = %d", $fid));
            //  use imagecache (imagecache, preset_name, file_path, alt, title, array of attributes)
            if (module_exists('imagecache') && is_array(imagecache_presets()) && $vars['imgcache_slide'] <> '<none>'){
              $slider_items[$key1]['slide_image'] = 
              theme('imagecache', 
                    $vars['imgcache_slide'], 
                    $filepath,
                    check_plain($result->node_title));
            }
            else {          
              $slider_items[$key1]['slide_image'] = 
                '<img src="' . base_path() . $filepath . 
                '" alt="' . check_plain($result->node_title) . 
                '"/>';     
            }          
          }
          // add slide_text variable
          if (isset($result->node_data_field_pager_item_text_field_slide_text_value)) {
            $slider_items[$key1]['slide_text'] =  check_markup($result->node_data_field_pager_item_text_field_slide_text_value);
          }
          // add slide_title variable
          if (isset($result->node_title)) {
            $slider_items[$key1]['slide_title'] =  check_plain($result->node_title);
          }
          // add slide_read_more variable and slide_node variable
          if (isset($result->nid)) {
            $slider_items[$key1]['slide_read_more'] =  l('Read more...', 'node/' . $result->nid);
            $slider_items[$key1]['slide_node'] =  base_path() . 'node/' . $result->nid;
          }
        }
      }
    }    
    $vars['slider_items'] = $slider_items;
  }
}  
/**
 * Override or insert variables into the ddblock_cycle_pager_content templates.
 *   Used to convert variables from view_fields  to pager_items template variables
 *  Only used for custom pager items
 *
 * @param $vars
 *   An array of variables to pass to the theme template.
 *
 */
function admire_gray_preprocess_ddblock_cycle_pager_content(&$vars) {
  if (($vars['output_type'] == 'view_fields') && ($vars['pager_settings']['pager'] == 'custom-pager')){
    $content = array();
    // Add pager_items for the template 
    // If you use the devel module uncomment the following lines to see the theme variables
    // dsm($vars['pager_settings']['view_name']);     
    // dsm($vars['content'][0]);     
    // If you don't use the devel module uncomment the following lines to see the theme variables
    // drupal_set_message('<pre>' . var_export($vars['pager_settings'], true) . '</pre>');
    // drupal_set_message('<pre>' . var_export($vars['content'][0], true) . '</pre>');
    if ($vars['pager_settings']['view_name'] == 'news_items') {
      if (!empty($vars['content'])) {
        foreach ($vars['content'] as $key1 => $result) {
          // add pager_item_image variable
          if (isset($result->node_data_field_image_field_image_fid)) {
            $fid = $result->node_data_field_image_field_image_fid;
            $filepath = db_result(db_query("SELECT filepath FROM {files} WHERE fid = %d", $fid));
            //  use imagecache (imagecache, preset_name, file_path, alt, title, array of attributes)
            if (module_exists('imagecache') && 
                is_array(imagecache_presets()) && 
                $vars['imgcache_pager_item'] <> '<none>'){
              $pager_items[$key1]['image'] = 
                theme('imagecache', 
                      $vars['pager_settings']['imgcache_pager_item'],              
                      $filepath,
                      check_plain($result->node_data_field_pager_item_text_field_pager_item_text_value));
            }
            else {          
              $pager_items[$key1]['image'] = 
                '<img src="' . base_path() . $filepath . 
                '" alt="' . check_plain($result->node_data_field_pager_item_text_field_pager_item_text_value) . 
                '"/>';     
            }          
          }
          // add pager_item _text variable
          if (isset($result->node_data_field_pager_item_text_field_pager_item_text_value)) {
            $pager_items[$key1]['text'] =  check_plain($result->node_data_field_pager_item_text_field_pager_item_text_value);
          }
        }
      }
    }
    $vars['pager_items'] = $pager_items;
  }    
}

Comments

ppblaauw’s picture

Priority: Critical » Normal

Your Template.php file and the result of the debug lines match.

That your modules are not in the recommended place has no consequence for the slideshow (only for updating the site it is recommended to place contributed modules in sites/all/modules.

The only thing I can think of is: Do you have at least 2 published nodes for the slideshow?
Do you have a link to the slideshow on your Drupal site?

Minor posting tip:

Support request should have priority normal or minor.
Setting it to critical will not speed up getting a response, maybe even the opposite.
Describing the issue well will increase getting quick and the right answer (You did this very well)

sobione’s picture

Priority: Normal » Critical

Thanks for the quick response, and the critical vs. normal/minor tip.

I have 2 published nodes for the slideshow, each with a graphic imported as well as the rest of the various fields completed.

My drupal site is www.blgaming.com, and the block is at content top.

I can't really imagine why it won't work.

sobione’s picture

Status: Active » Fixed

it seems to work when i changed the template from custom (as instructed in the video) to upright40. Thanks again for your insight and I will be sure to post again on here if I continue to have trouble.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pmathur01’s picture

Assigned: Unassigned » pmathur01
Priority: Critical » Normal
Status: Closed (fixed) » Active
StatusFileSize
new6.85 KB
new5.83 KB
new2.46 KB

Hi I am having this same issue of gray images. I have tried to do everything from the previous issues but still in vain. At first the block was not visible but that I have solved when I changed from custom template to upright 40. But now I am left with the gray box. I tried to reinstall my views but still no change. flushed the caches, ran updates.
I have three contents of type news items. I have attached the gray box image, the template and the debug output. I am just stuck with this awesome feature...Is there something that I am missing..

ppblaauw’s picture

Assigned: pmathur01 » Unassigned
Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new5.79 KB

#5

node_data_field_pager_item_text_field_image_fid

needs to be changed in

node_data_field_image_field_image_fid

Attached the changed preprocess functions in template31.php_.txt

You can copy them to your template.php file.

Hope this helps you further, please let me know.

pmathur01’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Thanks a lot.. I was able to get it to work with your help. It just saved my day as I have to make a presentation tomorrow.

teju’s picture

Hello Friends,

I need help.

I used dynamic display block module i followed all steps which are included in ddblock tutorials but it does not shows images it only shows me gray block.I don't understand what exactly the problem is.

Here is the debugging information

'news_items'
stdClass::__set_state(array(
   'nid' => '548158',
   'node_title' => 'Testing for ddblock slideshow',
   'node_data_field_pager_item_text_field_pager_item_text_value' => 'Test',
   'node_type' => 'ddblock_news_item',
   'node_vid' => '548160',
   'node_data_field_pager_item_text_field_slide_text_value' => 'Testing for ddblock slideshow.Testing for ddblock slideshow.Testing for ddblock slideshowTesting for ddblock slideshow',
   'node_data_field_pager_item_text_field_image_fid' => '209',
   'node_data_field_pager_item_text_field_image_list' => '1',
   'node_data_field_pager_item_text_field_image_data' => 'a:2:{s:3:"alt";s:0:"";s:5:"title";s:0:"";}',
   'node_revisions_body' => 'Testing for ddblock slideshowTesting for ddblock slideshowTesting for ddblock slideshowTesting for ddblock slideshowTesting for ddblock slideshowTesting for ddblock slideshowTesting for ddblock slideshowTesting for ddblock slideshowTesting for ddblock slideshowTesting for ddblock slideshowTesting for ddblock slideshowTesting for ddblock slideshowTesting for ddblock slideshow',
   'node_revisions_format' => '1',
   'node_created' => '1322113238',
))

and here is the preprocessor functions which i have used in mytemplete.php


function waffles_preprocess_ddblock_cycle_block_content(&$vars) {
  if ($vars['output_type'] == 'view_fields') {
    $content = array();
    // Add slider_items for the template 
    // If you use the devel module uncomment the following line to see the theme variables
    // dsm($vars['settings']['view_name']);  
    // dsm($vars['content'][0]);
    // If you don't use the devel module uncomment the following line to see the theme variables
     drupal_set_message('<pre>' . var_export($vars['settings']['view_name'], true) . '</pre>');
     drupal_set_message('<pre>' . var_export($vars['content'][0], true) . '</pre>');
    if ($vars['settings']['view_name'] == 'news_items') {
      if (!empty($vars['content'])) {
        foreach ($vars['content'] as $key1 => $result) {
          // add slide_image variable 
          if (isset($result->node_data_field_pager_item_text_field_image_fid)) {
            // get image id
            $fid = $result->node_data_field_pager_item_text_field_image_fid;
            // get path to image
            $filepath = db_result(db_query("SELECT filepath FROM {files} WHERE fid = %d", $fid));
            //  use imagecache (imagecache, preset_name, file_path, alt, title, array of attributes)
            if (module_exists('imagecache') && is_array(imagecache_presets()) && $vars['imgcache_slide'] <> '<none>'){
              $slider_items[$key1]['slide_image'] = 
              theme('imagecache', 
                    $vars['imgcache_slide'], 
                    $filepath,
                    check_plain($result->node_title));
            }
            else {          
              $slider_items[$key1]['slide_image'] = 
                '<img src="' . base_path() . $filepath . 
                '" alt="' . check_plain($result->node_title) . 
                '"/>';     
            }          
          }
          // add slide_text variable
          if (isset($result->node_data_field_pager_item_text_field_slide_text_value)) {
            $slider_items[$key1]['slide_text'] =  check_markup($result->node_data_field_pager_item_text_field_slide_text_value);
          }
          // add slide_title variable
          if (isset($result->node_title)) {
            $slider_items[$key1]['slide_title'] =  check_plain($result->node_title);
          }
          // add slide_read_more variable and slide_node variable
          if (isset($result->nid)) {
            $slider_items[$key1]['slide_read_more'] =  l('Read more...', 'node/' . $result->nid);
            $slider_items[$key1]['slide_node'] =  base_path() . 'node/' . $result->nid;
          }
        }
      }
    }    
    $vars['slider_items'] = $slider_items;
  }
}  
/**
 * Override or insert variables into the ddblock_cycle_pager_content templates.
 *   Used to convert variables from view_fields  to pager_items template variables
 *  Only used for custom pager items
 *
 * @param $vars
 *   An array of variables to pass to the theme template.
 *
 */
function waffles_preprocess_ddblock_cycle_pager_content(&$vars) {
  if (($vars['output_type'] == 'view_fields') && ($vars['pager_settings']['pager'] == 'custom-pager')){
    $content = array();
    // Add pager_items for the template 
    // If you use the devel module uncomment the following lines to see the theme variables
    // dsm($vars['pager_settings']['view_name']);     
    // dsm($vars['content'][0]);     
    // If you don't use the devel module uncomment the following lines to see the theme variables
    // drupal_set_message('<pre>' . var_export($vars['pager_settings'], true) . '</pre>');
    // drupal_set_message('<pre>' . var_export($vars['content'][0], true) . '</pre>');
    if ($vars['pager_settings']['view_name'] == 'news_items') {
      if (!empty($vars['content'])) {
        foreach ($vars['content'] as $key1 => $result) {
          // add pager_item_image variable
          if (isset($result->node_data_field_pager_item_text_field_image_fid)) {
            $fid = $result->node_data_field_pager_item_text_field_image_fid;
            $filepath = db_result(db_query("SELECT filepath FROM {files} WHERE fid = %d", $fid));
            //  use imagecache (imagecache, preset_name, file_path, alt, title, array of attributes)
            if (module_exists('imagecache') && 
                is_array(imagecache_presets()) && 
                $vars['imgcache_pager_item'] <> '<none>'){
              $pager_items[$key1]['image'] = 
                theme('imagecache', 
                      $vars['pager_settings']['imgcache_pager_item'],              
                      $filepath,
                      check_plain($result->node_data_field_pager_item_text_field_pager_item_text_value));
            }
            else {          
              $pager_items[$key1]['image'] = 
                '<img src="' . base_path() . $filepath . 
                '" alt="' . check_plain($result->node_data_field_pager_item_text_field_pager_item_text_value) . 
                '"/>';     
            }          
          }
          // add pager_item _text variable
          if (isset($result->node_data_field_pager_item_text_field_pager_item_text_value)) {
            $pager_items[$key1]['text'] =  check_plain($result->node_data_field_pager_item_text_field_pager_item_text_value);
          }
        }
      }
    }
    $vars['pager_items'] = $pager_items;
  }    
}

Please tell whats going wrong with this?

Thank you,
Teju.
www.caarcher.biz

ppblaauw’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

The fields in the preprocess functions are good when I see the debug lines. (no problem there)
Did you clear the cache?
Did you give permissions to the imagefield?
Did you give permissions to anonymous users to view ddblock slideshows?
Do you have a link to the page with the slideshow?

teju’s picture

Hi ppblaauw,

Thanks for your reply.
Yes i have checked all option which you have mentioned in your reply still it does not shows images.
Here is the link

www.bingoparadise.co.uk/test/

Thanks once again.
teju.
www.caarcher.biz

ppblaauw’s picture

The content container in the slideshow configuration page should be div.slide instead of img.

You can also have a look at the faq: http://ddblock.myalbums.biz/faq#19n881

teju’s picture

Hi ppblaauw,

Thanks for your great help.
It works but images are not showing properly.
can you please help me?

Thank you,
teju.
www.caarcher.biz

ppblaauw’s picture

Can you give me admin permission to the site?
It must have something to do with permissions.
You can send access info via my contact form when you can give the permissions.

teju’s picture

yes I have send you access information of site.
Please check it.

Thanks for your help.

Teju.
www.caarcher.biz

teju’s picture

Title: DDBlock - Gray box/no images or text showing (Fixed) » DDBlock - Gray box/no images or text showing
Status: Fixed » Postponed (maintainer needs more info)

Hello ppblaauw,

It works perfect.
Thanks for your great help.

thanks a lot.
Teju.

www.caarcher.biz

ppblaauw’s picture

Title: DDBlock - Gray box/no images or text showing » DDBlock - Gray box/no images or text showing (Fixed)
Status: Postponed (maintainer needs more info) » Fixed

Set status to fixed.

Title: DDBlock - Gray box/no images or text showing » DDBlock - Gray box/no images or text showing (Fixed)
Status: Postponed (maintainer needs more info) » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.