I have been installed advanced ddblock by tutorial, by importing views and cck. I read documentation and tutorials carefully.
Theme are installed in sites/all/themes/agnian
Uncommenting drupal_set_message functions returns, "ddblock-News item slideshow".
This is my template.php
<?php
/*!
* Dynamic display block preprocess functions
* Copyright (c) 2008 - 2009 P. Blaauw All rights reserved.
* Version 1.3 (18-MAR-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 agnian_preprocess_ddblock_cycle_block_content(&$vars) {
if ($vars['output_type'] == 'views_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'] == 'ddblock-News') {
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,
$result->node_title);
}
else {
$slider_items[$key1]['slide_image'] =
'<img src="' . base_path() . $filepath .
'" alt="' . $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'] = $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'] = $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'] = '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 agnian_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'] == 'ddblock-News') {
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,
$result->node_data_field_pager_item_text_field_pager_item_text_value);
}
else {
$pager_items[$key1]['image'] =
'<img src="' . base_path() . $filepath .
'" alt="' . $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'] = $result->node_data_field_pager_item_text_field_pager_item_text_value;
}
}
}
$vars['pager_items'] = $pager_items;
}
}
}
Comments
Comment #1
Toktik commentedI forget. And I receive "warning: Invalid argument supplied for foreach() in /home/agnianc/public_html/web/sites/all/themes/agnian/custom/modules/ddblock/ddblock-cycle-block-content-upright10.tpl.php on line 47." error.
Comment #2
Toktik commentedThe CSS call's normal, I think.
And here Javascript call.
And here HTML code
My theme is upright10, the file "ddblock-cycle-block-content-upright10.tpl.php" is default, not modified.
Any ideas?
Comment #3
ppblaauw commentedI am not at home, at the moment in an internetcafe.
Could you send what is the result of the dsm lines you uncommented, They are collapsed, you can click on the link to see the values.
If you uncomment the drupal_set_message debug lines instead you get a result which is not collapsed.
Maybe your view_name is different than defined in the proprocess functions.
You can also have a look at the faq for troubelshooting at http://ddblock.myalbums.biz or have a look at the other issues in the issue queue. (also look at the closed ones)
Hope this helps you further, please let me know.
I am back at home on friday.
Comment #4
Toktik commentedFAQ already I read, no helps...
Where I should see the output of dsm functions? There is no output in the footer where is the block enabled...
I have devel module installed, and enabled, with themeer info.
I attached the report from theme registry in the devel block.
Comment #5
ppblaauw commentedIf you don't see the debug messages in the screen where the ddblock is placed your template.php is not found.
Is it created in the theme you use?
Comment #6
Toktik commentedYes it is created in the theme. In the template.php only ddblock preprocess functions.
Comment #7
ppblaauw commentedI don't know why your theme does not find the template.php file.
Could you try to install the ddblock themes and preprocess functions with the garland theme like you did with the theme you use now to see if this works and to find out if the theme you use causes the issue.
Comment #8
Toktik commentedSame problem with garland :( No debug output.
Comment #9
ppblaauw commentedI don't no why on your installation template.php files are not recognized.
Can you try uncommenting the drupal_set_message debug lines instead of the dsm lines in the preprocess functions and disable the devel module?
Also try to clear your cache at Administer > Site configuration > Performance or when using the devel module in the menu of the devel module.
Do you have a link to your Internet site?
Comment #10
Toktik commenteddrupal_set_message. no output :(
I send you site address to email.
Comment #11
ppblaauw commentedI don't see a dynamic display block on the site, can you put the ddblock block you made in one of the regions.
Comment #12
Toktik commentedSorry, I forget about user permissions. The block is in footer! :) Now is ok! check it :)
Comment #13
ppblaauw commentedOk, I see the block now but still no debug messages.
If you have the drupal_set_message lines uncommented in the preprocess functions in the template.php file, the issue is: the template.php file is not found, but i don't know why.
The theme system should find the template.php file in: /web/sites/all/themes/agnian/
The only difference with other installations I see is the web directory in front of sites/all/themes.
Is this because you have a multi domain installation?
When you make a copy of the garland theme in your sites/all/themes folder and rename it to mygarland (also rename the garland.info file to mygarland.info and edit this file to set the name = mygarland) enable it and choose as default theme.
In the template.php of garland you have the breadcrumbs functions change e.g. > to ||.
Do you see this change then in the breadcrumb. If yes the template.php file is found in garland.
You can also copy this breadcrumb function to your template.php file of the agnian theme to see if the separator between breadcrumbs is changed.
Maybe there are easier ways to find out if your template.php file is recognized, but I hope this helps you further to get the template.php file recognized.
Comment #14
Toktik commentedtemplate.php i think founds. because if I do syntax error drupal reacts...
Comment #15
ppblaauw commentedCould you add the following lines at the top of the content preprocess function in your template.php file
Before the if statment
Comment #16
Toktik commentedWorks :) Slideshow now displayed, but no picture, check it please. But why, when I add the debug functions before if, the slideshow now displayed! why?
Comment #17
Toktik commentedNow all is displaying, except image. Whats the problem? And second question. How to set another image size for upright10 theme?
Comment #18
ppblaauw commentedYou need to change (4x) in the preprocess functions the image fieldname
to
You can find information about changing sizes of ddblock themes in the FAQ at ddblock.myalbums.biz
Hope this helps you further, please let me know.
Comment #19
Toktik commentedWorks! :) Thank you very much for helping me :)
Comment #20
ppblaauw commentedSet status to fixed
Comment #21
Toktik commentedComment #22
Toktik commentedThere are issue in first message. In second function, in
if ($vars['output_type'] == 'views_fields') {views_fields, should be view_field.
Comment #23
Toktik commentedI don't know what settings have been changed. But now I'm getting grey box(no image) and this is debug info. I see, there is no image field :( why?
Comment #24
ppblaauw commentedAs you can see in the result of the debug lines, the image field is not provided anymore by cck/views.
Did you change:
permissions?
enabled content permissions module?
the view?
the content type?
Does the view you use itself show the images?
Hope this helps you solving the issue, please let me know.
Comment #25
Toktik commentedIn the Node View the image's shows normally. No permission has been changed. Views is normal, there "Image linked to node". Content type is normal I think, here is settings from content type.
" Image
field_image File"
Comment #26
Toktik commentedNo ideas? I think, reinstall will help. :)
Comment #27
ppblaauw commentedThe result of the drupal_set_message lines is still the same?
Are you using image cache or not?
Did you change file download setting (public/private)?
Still more options what can cause the issue.
Can you send result of drupal_set_message debug lines of both preprocess functions again and your template.php.
Will look at it tomorrow, time to go home
Comment #28
Toktik commentedok, now I'm reinstalling ddblock from scratch, if problem will exist, I will inform you.
Comment #29
ppblaauw commentedSet status to closed, 10 weeks without activity.
See ddblock works at posters site.
Comment #30
suncanoe commentedI have the same problem, How are you to resolve this problem?
can you give a whole resolve solution?
Comment #31
ppblaauw commented#30 You can have a look at the faq question: http://ddblock.myalbums.biz/faq#19n805
Hope this helps you further, please let me know.