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;
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | template31.php_.txt | 5.79 KB | ppblaauw |
| #5 | ddblock debug output.txt | 2.46 KB | pmathur01 |
| #5 | template_ddblock.txt | 5.83 KB | pmathur01 |
| #5 | ddblock image.jpg | 6.85 KB | pmathur01 |
| templatephp.txt | 6.16 KB | sobione |
Comments
Comment #1
ppblaauw commentedYour 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)
Comment #2
sobione commentedThanks 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.
Comment #3
sobione commentedit 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.
Comment #5
pmathur01 commentedHi 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..
Comment #6
ppblaauw commented#5
needs to be changed in
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.
Comment #7
pmathur01 commentedThanks 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.
Comment #8
teju commentedHello 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
and here is the preprocessor functions which i have used in mytemplete.php
Please tell whats going wrong with this?
Thank you,
Teju.
www.caarcher.biz
Comment #9
ppblaauw commentedThe 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?
Comment #10
teju commentedHi 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
Comment #11
ppblaauw commentedThe 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
Comment #12
teju commentedHi 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
Comment #13
ppblaauw commentedCan 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.
Comment #14
teju commentedyes I have send you access information of site.
Please check it.
Thanks for your help.
Teju.
www.caarcher.biz
Comment #15
teju commentedHello ppblaauw,
It works perfect.
Thanks for your great help.
thanks a lot.
Teju.
www.caarcher.biz
Comment #16
ppblaauw commentedSet status to fixed.