No Images Displayed, and IE Gray Box

trijump3540 - March 25, 2009 - 16:25
Project:Dynamic display block
Version:6.x-1.0-rc6
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi,

I really like the potential of this module, but I just can't seem to get the advanced slide show working. I've walked through the advanced tutorial and followed all of those steps to make the content type and view. But I'm having a problem.

In Firefox, I get the slider text, the read more button, and the pager item text, but I don't get any image. In Internet Explorer 7, I just get a gray box, no slider text, no button, no pager text, no image. I uncommented the debug lines in my template.php file and the following was outputted:

array (
'delta' => '3',
'output_type' => 'view_fields',
'pager' => 'custom-pager',
'pager_container' => NULL,
'pager_event' => NULL,
'pager_height' => 63,
'pager_width' => 195,
'imgcache_pager_item' => '',
'pager_position' => 'top',
'template' => 'upright50',
'custom_template' => NULL,
'view_name' => 'news_items',
)

stdClass::__set_state(array(
'nid' => '72',
'node_title' => 'Red Dodge Viper',
'node_data_field_pager_item_text_field_pager_item_text_value' => 'Red Viper',
'node_data_field_pager_item_text_nid' => '72',
'node_type' => 'ddblock_news_item',
'node_data_field_pager_item_text_field_slide_text_value' => 'This is a red Dodge Viper',
'node_data_field_pager_item_text_field_image_fid' => '8',
'node_data_field_pager_item_text_field_image_list' => '1',
'node_data_field_pager_item_text_field_image_data' => 'a:3:{s:11:"description";s:0:"";s:3:"alt";s:0:"";s:5:"title";s:0:"";}',
'node_revisions_body' => 'This is the second try and a news item content type with a red Dodge Viper instead of a blue one. We shall see if this works... I have my doubts.',
'node_revisions_format' => '1',
'node_created' => '1237990114',
))

I attached a screen shot of how it looks in Firefox and how it looks in IE7. I've also attached my template.php file. Any suggestions you have would be greatly appreciated.

AttachmentSize
firefoxSS.JPG20.98 KB
ie7SS.JPG14.29 KB
template.php.txt11.8 KB

#1

ppblaauw - March 26, 2009 - 03:24
Status:active» needs review

Thanks for sending the template.php file and the result of the drupal_set_message debug lines

Due to changes in the filefield and imagfield modules The cck variables are different depending on the version you have installed.

In your case, to show the images in the ddblock slideshow, you need to change all occurrences of:

node_data_field_image_field_image_fid

to

node_data_field_pager_item_text_field_image_fid

Hope this helps you further, please let me know.

#2

trijump3540 - March 26, 2009 - 13:32

Thank you so much! I changed those lines and it works like a charm now.

#3

ppblaauw - March 27, 2009 - 04:56
Status:needs review» fixed

set status to fixed

#4

System Message - April 10, 2009 - 05:00
Status:fixed» closed

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

#5

quindio - June 30, 2009 - 17:35

I have been dealing with this prblem for over 2 weeks and today was the day I was going to give up. Iam glad I found this link because I was having the same problem.

I am glad that I found a fix for the problem but it should not be this hard. Somehow this information
should be added as part of the documentation.

Thanks,

Néstor :-)

#6

ppblaauw - July 1, 2009 - 04:17

@quindio

Thanks for pointing out, it is not always easy for users to find existing solutions for issues.
I made the reference to the FAQ on ddblock.myalbums.biz in red in the major tutorial pages and added to look at the trouble shooting part of the faq.

I hope users can find known solutions for issues better now.

#7

jiangqiqi77 - August 16, 2009 - 00:11

@ ppblaauw

Thank you for this module, I really like it.
Now I met the similar problems, and I have try to fix following the steps you provide, and I fixed parts, but here is another issue appearing, only the small pictures displaying, but the main pictures not displaying..

Here is my template.php and the screenshot.

I am new at Drupal..

Waiting for your response

AttachmentSize
template.txt 37.35 KB
grey_box.PNG 9.78 KB

#8

iren - August 16, 2009 - 00:35

@jiangqiqi77

I see one pager-item image.
The slideshow needs at least two nodes to work.

Hope this helps you further, please let me know.

#9

dunklea - September 18, 2009 - 16:23
Status:closed» active

I am still facing the same same problem.. Grey area in the box. Here is a link to my site:
http://www.gooverseas.com

AttachmentSize
template.php_.txt 8.48 KB

#10

ppblaauw - September 19, 2009 - 00:46
Status:active» postponed (maintainer needs more info)

@ dunklea
Please have a look at the faq question: Images not showing, only grey box.

If you can not solve it yourself, attach the result of the drupal_set_message lines, so I can help you better.

Hope this helps you further, please let me know.

#11

nikemen - November 3, 2009 - 10:34
Status:postponed (maintainer needs more info)» active

Hello,

I have the same problem, but in my case the image isn't just listed in the drupal_set_message. I paste here the result:

'news_items'
stdClass::__set_state(array(
'nid' => '3577',
'node_title' => 'Sobre molinos, gigantes y sabios encantadores',
'node_data_field_pager_item_text_field_pager_item_text_value' => 'Don Quijote',
'node_type' => 'story',
'node_vid' => '3579',
'node_data_field_pager_item_text_field_slide_text_value' => 'En esto descubrieron treinta o cuarenta molinos de viento que hay en aquel campo',
'node_created' => '1257212191',
))

Any ideas?
Thanks in advance!

#12

iren - November 4, 2009 - 01:02

#11

Did you enable the Content Permissions module (CCK - submodule)?

Did you give permission for the field you use in your slideshow block?

Can you send the content of the template.php file?

Can you send a link to the site?

Please provide this information so I can help you better.

Hope this helps you further, please let me know.

#13

nikemen - November 4, 2009 - 10:44

Thanks for your answer. I did not enable the Content Permissions module. Should I?
Here's the content of my template.php file. Note my theme is a subtheme of ZEN/The Morning After.

<?php
/*!
* 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 Panorama_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 Panorama_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;
  }   
}

The test address where you can reach my block is: http://panoramacatolico.info/pagina/pruebas
Thanks again!

#14

iren - November 5, 2009 - 06:02
Status:active» postponed (maintainer needs more info)

Thank you for the detailed information.

You don't need to enable the Content permission module, only if you want to give permission per field.

The template.php file looks ok.

Did you add the image_field in the content of the view?

Can you send the preview of the SQL statement in your view?

Hope this helps you further, please let me know.

#15

nikemen - November 5, 2009 - 16:01
Status:postponed (maintainer needs more info)» active

Here's the SQL result:

SELECT node.nid AS nid, node.title AS node_title, node_data_field_pager_item_text.field_pager_item_text_value AS node_data_field_pager_item_text_field_pager_item_text_value, node.type AS node_type, node.vid AS node_vid, node_data_field_pager_item_text.field_slide_text_value AS node_data_field_pager_item_text_field_slide_text_value, node.created AS node_created FROM node node  INNER JOIN term_node term_node ON node.vid = term_node.vid LEFT JOIN content_type_story node_data_field_pager_item_text ON node.vid = node_data_field_pager_item_text.vid WHERE (node.status <> 0) AND (term_node.tid = 1) ORDER BY node_created DESC
Again, thanks very much!

#16

iren - November 6, 2009 - 01:17
Status:active» postponed (maintainer needs more info)

#15

In the preview of the SQL result in the view, seems like you don't have a field for your image.

Can you give admin access to your site, so i can help you better?

You can send it to my contact form.

#17

iren - November 7, 2009 - 00:34

#15

I had a look at the site. For your image field you checked Group multiple values.

This needs to be unchecked, now you could see the image field variable in the view.

In the preprocess functions you need to change

node_data_field_pager_item_text_field_image_fid

4 times to

node_data_field_image_field_image_fid

Hope this helps you further, please let me know.

#18

nikemen - November 7, 2009 - 06:41
Status:postponed (maintainer needs more info)» fixed

Thanks very much!

#19

rinusdrupal01 - November 13, 2009 - 18:40
Status:fixed» active

Hello,

I have the same problem. I am using the theme acquia_slate. Can you please help me what I am doing wrong?
For the template i copy the following code in the exiting acquia_slate template file:

Also this error occurs every time:
warning: Invalid argument supplied for foreach() in /storage/mijndomein/users/019772/public/sites/richard.trendiescadeau.nl/sites/all/themes/acquia_slate/custom/modules/ddblock/ddblock-cycle-block-content-upright50.tpl.php on line 47.

function slideshow_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('' . var_export($vars['settings']['view_name'], true) . '');
// drupal_set_message('' . var_export($vars['content'][0], true) . '');
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'] <> ''){
$slider_items[$key1]['slide_image'] =
theme('imagecache',
$vars['imgcache_slide'],
$filepath,
check_plain($result->node_title));
}
else {
$slider_items[$key1]['slide_image'] =
'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 slideshow_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('' . var_export($vars['pager_settings'], true) . '');
// drupal_set_message('' . var_export($vars['content'][0], true) . '');
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'] <> ''){
$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'] =
'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;
}
}

The SQL-view is:
SELECT node.nid AS nid,
node.title AS node_title,
node_data_field_pager_item_text.field_pager_item_text_value AS node_data_field_pager_item_text_field_pager_item_text_value,
node.type AS node_type,
node.vid AS node_vid,
node_data_field_pager_item_text.field_slide_text_value AS node_data_field_pager_item_text_field_slide_text_value,
node_data_field_pager_item_text.field_image_fid AS node_data_field_pager_item_text_field_image_fid,
node_data_field_pager_item_text.field_image_list AS node_data_field_pager_item_text_field_image_list,
node_data_field_pager_item_text.field_image_data AS node_data_field_pager_item_text_field_image_data,
node_revisions.body AS node_revisions_body,
node_revisions.format AS node_revisions_format,
node.created AS node_created
FROM node node
LEFT JOIN content_type_ddblock_news_item node_data_field_pager_item_text ON node.vid = node_data_field_pager_item_text.vid
LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid
WHERE (node.status <> 0) AND (node.type in ('ddblock_news_item'))
ORDER BY node_created ASC

Thanks a lot for the solution,

Richard

#20

ppblaauw - November 14, 2009 - 01:50
Status:active» postponed (maintainer needs more info)

#19

In your preprocess functions you need to use the themename you use so the preprocess functions become:

function acquia_slate_preprocess_ddblock_cycle_block_content(&$vars) {

function acquia_slate_preprocess_ddblock_cycle_pager_content(&$vars) {

after making the changes, clear the cache at administer > site configuration > performance

Hope this helps you further, please let me know.

#21

rinusdrupal01 - November 14, 2009 - 10:30
Status:postponed (maintainer needs more info)» closed

Thanks a lot.... That was the problem...

Richard

 
 

Drupal is a registered trademark of Dries Buytaert.