Hi all,
I don't know if this is the right place to post this, but it is worth the try. Well, I installed the module, followed the instructions in the tutorial, the block shows, shows its contents... problem is... it does not slide. It shows the pager images, the texts, everything. But it does not slide. Does anybody have any pointers on how I might debug this?
the drupal version is 6.15, and the ddblock version is 6.x-1.0
Thanks in advance,
Gustavo
ps. this is the content of the template.php file
/*!
* 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 acquia_prosper_preprocess_ddblock_cycle_block_content(&$vars) {
function acquia_prosper_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'][1], true) . '');
if ($vars['settings']['view_name'] == 'news_items') {
if (!empty($vars['content'])) {
foreach ($vars['content'] as $key1 => $result) {
// add slide_image variable ^M
// drupal_set_message('' . $result[0] . '');
if (isset($result->node_data_field_image_field_image_fid)) {
// if (isset($result->node_data_field_pager_item_text_field_image_fid)) {
// get image id
// drupal_set_message('Entro');
// $fid = $result->node_data_field_pager_item_text_field_image_fid;
$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));
// drupal_set_message(' ' . $filepath . '');
// use imagecache (imagecache, preset_name, file_path, alt, title, array of attributes)
if (module_exists('imagecache') && is_array(imagecache_presets()) && $vars['imgcache_slide'] <> ''){
// drupal_set_message(' ENTRO 2 ');
$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;
}
// drupal_set_message('' . $slider_items[$key1][slide_image] . '');
}
}
}
$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 acquia_prosper_preprocess_ddblock_cycle_pager_content(&$vars) {
function acquia_prosper_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
// drupal_set_message('' . $result->node_data_field_pager_item_text_field_image_fid . '');
// if (isset($result->node_data_field_pager_item_text_field_image_fid)) {
//if (isset($result->node_data_field_pager_item_text_field_image_fid)) {
// $fid = $result->node_data_field_pager_item_text_field_image_fid;
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'] <> ''){
$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;
}
}
?>
again, thanks in advance
Re: Slideshow does not slide
There is no ddblock version 6.x-1.0.
Please make an issue in the issue queue of the module you use.
Do you have a link to the slideshow on your Drupal site?
Same problem
I'm having the exact same problem. I inserted the view into a paneled page, the homepage of a site I'm working on. And I get a listing of text above and below the 3 images (news items) that are supposed to make up the slide show..... this is driving me a bit batty to say the least. If I find anything on the drupal site I'll post a link back in here. Please do the same.
Jeffrey
Found "something"
I just figured out part of this. I'm using panels to build the homepage of the site. What I was doing was placing the "view" in one of the panes... and not the block itself. I got rid of the "view" and replaced it with what I think is the "block" but I can't tell for sure. The slides started working when I did this but now I've got this code showing up on the page which looks to be part of the code for the News Item Content.
http://drupal.org/node/720220
This seems to have me on some path to maybe get this darned thing working right. Anyway, check out the drupal node. Depending on what your exact issues maybe it will reveal a couple clues for you.
Jeffrey
Just got it to work
Just got it to work, I added the following line to the Custom JQuery Cycle Plugin Settings
{"fastOnEvent": 0}
Cheers,
Re: Just got it to work
Probably you had a javascript error on your page before when you did not add the {"fastOnEvent": 0} line in the custom jquery cycle plugin field.
Maybe you are using a wysiwyg editor which adds a <p></p> tag to this field. You need to disable the wysiwyg editor for this field.
By design the ddblock module uses fastOnEvent": 1, so user can quickly go from slide to slide without having to wait on the original slide effect.
What you did with adding {"fastOnEvent": 0} is that the original effect is also used when clicking on a pager item, at the same time it solved that the wysiwig editor does not add the empty <p></p> tag which solves the javascript error.
Hope this explains more.