Hi to everybody ºº!!
I've been following all tutorial steps, but I arrived to a warning where no images, and no text is showing up.
I get a warning message about line 41, see the link --> www.pausenabre.com/img/fail.png
it happens to me in every single template! :(
any idea?
Thanks a lot !!
Such a great article it was
Such a great article it was which tutorial steps, but a warning where no images, and no text is showing up. In which it happens to me in every single template. Thanks for sharing this article.
Re: problem line 41 (warning)
Have a look at the faq question: warning: Invalid argument supplied for foreach() in... solution?
Hope this helps you further, please let me know.
If not make an issue in the issue queue of the module.
Still not working
Thanks for answer me that quick.
well I tried cleaning the cache, coping the preprocesses functions, but if I copy the preprocess functions into my template.php, the theme is broke, and I just see a blank page :(
About this one (Is your view_name you use the same as the view_name in the if statement in the preprocess functions in your template.php file in the theme you use?) well in the preprocesses the view_name is a variable, so that has not to be the problem, isn't it?
the code of my template.php is the following:
/*! * Dynamic display block preprocess functions * Copyright (c) 2008 - 2009 P. Blaauw All rights reserved. * Version 1.6 (01-OCT-2009) * Licenced under GPL license */ /** * 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 adt_prt_galaxy_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 adt_prt_galaxy_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 ($vars['pager_settings']['news_items'] == '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; } }Re: Still not working
Please make an issue in the issue queue of the module. It is better suited for solving issues, adding attachments and is more useful for other users.
I don't see a reason why adding the preprocess functions should break your theme.
Do you have a link to the Internet site, so I can help you better?