Closed (fixed)
Project:
Dynamic display block
Version:
7.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 Apr 2011 at 10:26 UTC
Updated:
28 May 2011 at 13:57 UTC
Jump to comment: Most recent file
Comments
Comment #1
sinav sonuclari commentedDrupal set messages;
* Notice: Undefined index: output_type in danland_preprocess_ddblock_cycle_pager_content() (line 112 of /home/XXX/public_html/themes/danland/template.php).
* Notice: Undefined index: output_type in danland_preprocess_ddblock_cycle_block_content() (line 50 of /home/XXX/public_html/themes/danland/template.php).
Comment #2
ppblaauw commentedWhat code do you use in the preprocess functions in the template.php file.
Normally you should not have to use preprocess functions at all for the ddblock module for drupal 7.
You would only need preprocess functions when you have requirements which can not be handled by views.
Comment #3
sinav sonuclari commentedI wonder how I need to make an arrangement?
Template Code;
<?php
// $Id: template.php,v 1.10.4.3 2010/12/14 03:30:39 danprobo Exp $
function danland_page_class($sidebar_first, $sidebar_second) {
if ($sidebar_first && $sidebar_second) {
$id = 'layout-type-2';
}
else if ($sidebar_first || $sidebar_second) {
$id = 'layout-type-1';
}
if(isset($id)) {
print ' id="'. $id .'"';
}
}
function danland_preprocess_html(&$vars) {
// Add conditional CSS for IE6.
drupal_add_css(path_to_theme() . '/style.ie6.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'IE
6', '!IE' => FALSE), 'preprocess' => FALSE));
}
function danland_preprocess_maintenance_page(&$variables) {
if (!$variables['db_is_active']) {
unset($variables['site_name']);
}
drupal_add_css(drupal_get_path('theme', 'danland') . '/maintenance.css');
drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js');
}
if (drupal_is_front_page()) {
drupal_add_js(drupal_get_path('theme', 'danland') . '/scripts/jquery.cycle.all.js');
}
/*!
* 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 danland_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('
');
// drupal_set_message('
');
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'] <>
''){
'" alt="' . check_plain($result->node_title) .
$slider_items[$key1]['slide_image'] =
theme('imagecache',
$vars['imgcache_slide'],
$filepath,
check_plain($result->node_title));
}
else {
$slider_items[$key1]['slide_image'] =
'
'"/>';
}
}
// 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 danland_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('
');
// drupal_set_message('
');
'" alt="' . check_plain($result->node_data_field_pager_item_text_field_pager_item_text_value) .
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_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'] <> ''){
$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'] =
'
'"/>';
}
}
// 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 #4
ppblaauw commentedI see you use the preprocess functions from ddblock for Drupal 6.
These preprocess functions are not needed anymore. ( you can delete the preprocess function and clear the cache)
In the Drupal 7 version of ddblock:
Mapping of views_fields to slideshow theme fields is done in the configuration page of a ddblock instance in the mappings section.
Hope this helps you further, please let me know.
Comment #5
sinav sonuclari commentedI checked the fields do not have a problem with the views in alright, preprocess functions could not see the problem, and committed the same code. You said preprocess can be deleted when I deleted the error is not working
Comment #6
sinav sonuclari commentedpreprocess the code was doing a small mistake and looked up as you say thank you resolved the problem
Comment #7
sinav sonuclari commentedComment #8
deelite commentedI have the problem, that i don't get any output from ddblock (7.x-1.0-beta1).
I configured a block in a view with fields link, text, title and node-id. I checked the contenttype and the view in ddblock. Than i have created an instance with the view. After that i configured the ddblock as you can see on the images.
I think, there is nothing more to do. But i can only see the title of the block. No output from ddblock.
Can anyone help me about that? I need that module so much!
Thanks for reading that!
Sorry for my simple english!
Comment #9
ppblaauw commented#8
You only want to fade in a title and text?
Do you have a link to your site?
Comment #10
deelite commentedThanks for your reply.
I want to scroll (left). Fade was temporary in try and error ;-)
Sorry, i have the site only local. Can i give you any other information?
Comment #11
deelite commentedI can configure a connection to the site for you. The link i will send you via pn.