Pager Images not appearing

bhylenski - November 8, 2009 - 12:49
Project:Dynamic display block
Version:6.x-1.0-rc6
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hello,

I've read thru many of these issues and can't seem to solve this issue. Everything seems to be working properly with site, except the page images. When I set the pager to number or template 10/20, then it works fine, but the minute I use 30-50, or the custom pager to display my thumbnails...nothing appears...text, images nothing.

Versions
DDBLOCK: 6.x-1.0-rc6
Views Slideshow: 6.x-2.0-beta2
Imagefield: 6.x-3.2

Here are the preset messages:

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' => 'lightbox',
  'pager_position' => 'bottom',
  'template' => 'upright30',
  'custom_template' => NULL,
  'view_name' => 'news_items',
)stdClass::__set_state(array(
   'nid' => '813',
   'node_title' => 'News Item 1 - New Gallery',
   'node_data_field_pager_item_text_field_pager_item_text_value' => 'New Gallery',
   'node_type' => 'ddblock_news_item',
   'node_vid' => '813',
   'node_data_field_slide_text_field_slide_text_value' => 'New Gallery',
   'node_data_field_image_field_image_fid' => '233',
   'node_data_field_image_field_image_list' => '0',
   'node_data_field_image_field_image_data' => 'a:9:{s:8:"duration";i:0;s:6:"height";i:2592;s:5:"width";i:1944;s:18:"audio_bitrate_mode";s:0:"";s:18:"audio_channel_mode";s:0:"";s:12:"audio_format";s:0:"";s:13:"audio_bitrate";i:0;s:17:"audio_sample_rate";i:0;s:11:"description";s:0:"";}',
   'node_revisions_body' => 'Test Gallery, see how it looks....yeahh!
Test Gallery, see how it looks....yeahh!
Test Gallery, see how it looks....yeahh!
Test Gallery, see how it looks....yeahh!
Test Gallery, see how it looks....yeahh!
Test Gallery, see how it looks....yeahh!
',
   'node_revisions_format' => '1',
   'node_created' => '1257091595',
))

Here is my ddblock functions withintemplate.php:

<?php
//template for Marinelli Theme
//author: singalkuppe - www.signalkuppe.com


/*!
* 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 marinelli_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' || $vars['settings']['view_name'] == 'Hammock_Authors') {
      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 marinelli_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['settings']['view_name'] == 'news_items' || $vars['settings']['view_name'] == 'Hammock_Authors') {     
    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;
  }   
}

I'm not sure what is going on, if I change the variables within preprocess functions, then the main image doesn't appear either.. Any help would be appreciated. Please let me know what other pieces of info. I can give to help.

Thank you

#1

iren - November 9, 2009 - 00:32
Status:active» postponed (maintainer needs more info)

Thanks for the detailed information.

In the preprocess function marinelli_preprocess_ddblock_cycle_pager_content, you need to change

node_data_field_pager_item_text_field_image_fid

2 times to

node_data_field_image_field_image_fid

Hope this helps you further, please let me know.

#2

bhylenski - November 9, 2009 - 07:39

That did not work. I had already tried that, a few different times, since it always seemed to be the answer for everyone else.

I cleared the views cache and performance cache, as well as browser cache and still not possible.

Here are the current results:

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' => 'gallery_thumbnail',
  'pager_position' => 'bottom',
  'template' => 'upright40',
  'custom_template' => NULL,
  'view_name' => 'news_items',
)stdClass::__set_state(array(
   'nid' => '813',
   'node_title' => 'News Item 1 - New Gallery',
   'node_data_field_pager_item_text_field_pager_item_text_value' => 'New Gallery',
   'node_type' => 'ddblock_news_item',
   'node_vid' => '813',
   'node_data_field_slide_text_field_slide_text_value' => 'New Gallery',
   'node_data_field_image_field_image_fid' => '233',
   'node_data_field_image_field_image_list' => '0',
   'node_data_field_image_field_image_data' => 'a:9:{s:8:"duration";i:0;s:6:"height";i:2592;s:5:"width";i:1944;s:18:"audio_bitrate_mode";s:0:"";s:18:"audio_channel_mode";s:0:"";s:12:"audio_format";s:0:"";s:13:"audio_bitrate";i:0;s:17:"audio_sample_rate";i:0;s:11:"description";s:0:"";}',
   'node_revisions_body' => 'Test Gallery, see how it looks....yeahh!
Test Gallery, see how it looks....yeahh!
Test Gallery, see how it looks....yeahh!
Test Gallery, see how it looks....yeahh!
Test Gallery, see how it looks....yeahh!
Test Gallery, see how it looks....yeahh!
',
   'node_revisions_format' => '1',
   'node_created' => '1257091595',
))

Is there any other information you need from me. I madethe changes, but I'm still seeing null fields for the pager...Within DDBlock instances, I turn pager on, set upright 40 and set it to custom pager, is there anywhere else this is set. The moment I turn it to upright10, everything works fine. This is one of the last two pieces to my site to be completed, so I really appreciate your help.

#3

bhylenski - November 9, 2009 - 07:40
Status:postponed (maintainer needs more info)» active

#4

iren - November 9, 2009 - 08:05
Status:active» postponed (maintainer needs more info)

Can you again send the changed template.php file.
Do you have a link to the Internet site?

#5

bhylenski - November 9, 2009 - 12:24
Status:postponed (maintainer needs more info)» active

Here is the template.php file:

<?php
//template for Marinelli Theme
//author: singalkuppe - www.signalkuppe.com


/*!
* 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 marinelli_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' || $vars['settings']['view_name'] == 'Hammock_Authors') {
      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->node_data_field_pager_item_text_field_url_value)) {
  $slider_items[$key1]['slide_read_more'] =  l('Read more...', $result->node_data_field_pager_item_text_field_url_value);
  }
elseif (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 marinelli_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['settings']['view_name'] == 'news_items' || $vars['settings']['view_name'] == 'Hammock_Authors') {     
    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;
  }   
}

Send me an email to bhylenski@yahoo.com and I will send your email an temp admin acct if you need access.

website : http://www.hylenskihammock.com/redesign

Their are two ddblocks, one on the homepage and one on the "hammock Talk" page, neither will show pagers.

Thanks again for your help.
Bryan

#6

iren - November 10, 2009 - 00:46
Status:active» postponed (maintainer needs more info)

I see now that you probably made a copy of the content block preprocess function in your pager content preprocess function to select the views.

In the preprocess function marinelli_preprocess_ddblock_cycle_pager_content, you need to change

    if ($vars['settings']['view_name'] == 'news_items' || $vars['settings']['view_name'] == 'Hammock_Authors')

into:

    if ($vars['pager_settings']['view_name'] == 'news_items' || $vars['pager_settings']['view_name'] == 'Hammock_Authors')

Hope this helps you further, please let me know.

#7

bhylenski - November 10, 2009 - 12:21
Status:postponed (maintainer needs more info)» closed

You are the man! Everything is back on track...not sure why I didn't catch that! Seems like my issues are always coding mistakes I make...I'll take not of that for future issues. Thank you very much for wasting your time on my stupidity, bro! Issue closed

 
 

Drupal is a registered trademark of Dries Buytaert.