Posted by firemountain on February 17, 2009 at 1:09am
4 followers
Jump to:
| Project: | Dynamic display block |
| Version: | 6.x-1.0-rc4 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
i am post install and am seeing only a views list, listing all the fields and the picture but no ddblock being rendered. i can't understand. i think this is a problem with the preprocess because if i take it out or put it in i get the same event. but i have no idea why the preprocess is not firering. i have tired in differnt themes, including garland, and the ddblock vomes out the same, as a regualr view.
when i go to configure the block the path is given as a ddblock not a normal view. so i am confused. has anyone else had a problem with this. this is what my template looks like.
<?php
//template for Marinelli Theme
//author: singalkuppe - www.signalkuppe.com
function marinelli_width($left, $right) {
$width = 625;
if (!$left ) {
$width = $width +315;
}
if (!$right) {
$width = $width +0;
}
return $width;
}
/**
* Return a themed breadcrumb trail.
*
* @param $breadcrumb
* An array containing the breadcrumb links.
* @return a string containing the breadcrumb output.
*/
function phptemplate_breadcrumb($breadcrumb) {
/** if (!empty($breadcrumb)) {
$breadcrumb[] = drupal_get_title();
array_shift($breadcrumb);
return '<div class="path"><p>'. implode(' / ', $breadcrumb) .'</p></div>';
} */
}
//overrides taxonomy term page function
function marinelli_taxonomy_term_page($tids, $result) {
drupal_add_css(drupal_get_path('module', 'taxonomy') .'/taxonomy.css');
$output = '';
// Only display the description if we have a single term, to avoid clutter and confusion.
if (count($tids) == 1) {
$term = taxonomy_get_term($tids[0]);
$description = $term->description;
// Check that a description is set.
if (!empty($description)) {
$output .= '<div class="terminfo"><p>';
$output .= filter_xss_admin($description);
$output .= '</p></div>';
}
}
$output .= taxonomy_render_nodes($result);
return $output;
}
function marinelli_admin_page($blocks) {
$stripe = 0;
$container = array();
foreach ($blocks as $block) {
if ($block_output = theme('admin_block', $block)) {
if (empty($block['position'])) {
// perform automatic striping.
$block['position'] = ++$stripe % 2 ? 'left' : 'right';
}
if (!isset($container[$block['position']])) {
$container[$block['position']] = '';
}
$container[$block['position']] .= $block_output;
}
}
$output = '<div class="admin clear-block">';
$output .= '<div class="compact-link"><p>'; // use <p> for hide/show anchor
if (system_admin_compact_mode()) {
$output .= l(t('Show descriptions'), 'admin/compact/off', array('title' => t('Expand layout to include descriptions.')));
}
else {
$output .= l(t('Hide descriptions'), 'admin/compact/on', array('title' => t('Compress layout by hiding descriptions.')));
}
$output .= '</p></div>';
foreach ($container as $id => $data) {
$output .= '<div class="'. $id .' clear-block">';
$output .= $data;
$output .= '</div>';
}
$output .= '</div>';
return $output;
}
function marinelli_admin_block_content($content) {
if (!$content) {
return '';
}
if (system_admin_compact_mode()) {
$output = '<dl class="menu">';
foreach ($content as $item) {
$output .= '<dt>'. l($item['title'], $item['href'], $item['localized_options']) .'</dt>'; // use definition list per compact mode
}
$output .= '</dl>';
}
else {
$output = '<dl class="admin-list">';
foreach ($content as $item) {
$output .= '<dt>'. l($item['title'], $item['href'], $item['localized_options']) .'</dt>';
$output .= '<dd>'. $item['description'] .'</dd>';
}
$output .= '</dl>';
}
return $output;
}
function marinelli_system_admin_by_module($menu_items) { // admin by module page
$stripe = 0;
$output = '';
$container = array('left' => '', 'right' => '');
$flip = array('left' => 'right', 'right' => 'left');
$position = 'left';
// Iterate over all modules
foreach ($menu_items as $module => $block) {
list($description, $items) = $block;
// Output links
if (count($items)) {
$block = array();
$block['title'] = $module;
$block['content'] = theme('item_list', $items);
$block['description'] = t($description);
if ($block_output = theme('admin_block', $block)) {
if (!isset($block['position'])) {
// Perform automatic striping.
$block['position'] = $position;
$position = $flip[$position];
}
$container[$block['position']] .= $block_output;
}
}
}
$output = '<div class="bymodule">';
foreach ($container as $id => $data) {
$output .= '<div class="'. $id .' clear-block">';
$output .= $data;
$output .= '</div>';
}
$output .= '</div>';
return $output;
}
function phptemplate_get_primary_links() {
return menu_tree(variable_get('menu_primary_links_source', 'primary-links'));
}
// retrieve custom theme settings
$valore = theme_get_setting('menutype'); // if we choose dropdown
if($valore == '1'){
drupal_add_js(drupal_get_path('theme','marinelli').'/js/marinellidropdown.js'); // load the javascript
drupal_add_css(drupal_get_path('theme','marinelli').'/dropdown.css'); // load the css
}
/**
* 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 marinelli_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') {
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));
$slider_items[$key1]['slide_image'] = $filepath;
}
// 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 marinelli_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') {
foreach ($vars['content'] as $key1 => $result) {
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));
$pager_items[$key1]['image'] = $filepath;
}
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
#1
Your template.php file looks ok. The preprocess functions are ok.
Did you check the advanced settings checkbox in the configuration page of the block, because I don't see a theme CSS file in the page?
Check the advanced settings checkbox and choose one of the upright themes.
Hope this helps you further. Please let me know.
#2
yes i have checked a theme, in the advanced settings
i have tried all the themes and messeda round with custom theme too.
what else do you think it could be??
#3
WOW ok looks like something happened now. Some how changing the themes again made a difference but now no picture is showing up. hmm... i changed around things a bunch so i must of done something right or wrong...
thank you so much for your help, in looking into this for me i want to make ddblock the main feature of the site.
any reason as to why the picture does not show, there is an unstyled pager but no picture.....
thanx so much
#4
please have a look at the site again...
there is a big green box on every page saying this....
_________________________-----
*
*
'news_items'
*
stdClass::__set_state(array(
'nid' => '153',
'node_title' => 'Climate Change in the context of 2012',
'node_data_field_pager_item_text_field_pager_item_text_value' => 'Climate Change ',
'node_data_field_pager_item_text_nid' => '153',
'node_type' => 'ddblock_news_item',
'node_data_field_pager_item_text_field_slide_text_value' => 'Looking at Fluctuating Climate and Natural Disasters, related to 2012 ',
'node_data_field_pager_item_text_field_image_fid' => '360',
'node_data_field_pager_item_text_field_image_list' => '1',
'node_data_field_pager_item_text_field_image_data' => 'a:1:{s:11:"description";s:0:"";}',
'node_revisions_body' => 'climate change na na na ',
'node_revisions_format' => '3',
'node_created' => '1234755605',
))
___________________________--
what is going on?>?>?
please help
#5
Ok
I see now on your site that the preprocess functions are working.
Will have a look at the site now to help you further
#6
thank you so so so much
#7
You have only one slide in your slideshow.
You need at least two slides to make the slideshow work
Just create another node for the block.
The "big green block" comes from the debug lines in the preprocess function.
You can just comment the drupal_set_message lines again in the preprocess function.
change
drupal_set_message('<pre>' . var_export($vars['settings']['view_name'], true) . '</pre>');drupal_set_message('<pre>' . var_export($vars['content'][0], true) . '</pre>');
to
//drupal_set_message('<pre>' . var_export($vars['settings']['view_name'], true) . '</pre>');//drupal_set_message('<pre>' . var_export($vars['content'][0], true) . '</pre>');
Hope this helps you further
#8
WOOOO!!
yes it is here!
its amazing! thank you,
thank you
thank you
thank you!
!!
!!
!!
!!
!!
#9
Looks almost good.
Only the pager is not styled because your pager is on custom pager in the configuration page and needs to be on prev/next pager if you use the theme upright20
It's a bug that the pager always goes back to custom pager when you go to the settings page, but in the next version it will be solved.
Also try the other pagers
Good luck!!
#10
You can also use the same block only once on a page.
You can use as many different block on one page.
#11
To make the read more button work uncheck the next setting in the configuration screen and please remove the second and third time you have the block on the same page to make the pager work.
#12
ppblaauw,
thank you so much
i have jsut troggled through all the themes
this is really one of the best display modules yet.
a real achievement and gift
thank you so much
one more question if you are still around..
how can i make clicking on the read more botton take me to the full node, i think the way it is set up is that it is supposed to go to the body of the node, but when i click it, it just puts a # in front of the domain e.g.(mydomain.com/#) and reloads the front page
#13
See #11 for the read more button
Your theme is interfering with the theme of the ddblock theme
Please add !important to the margin and padding of the img tags in the css files
like
div.ddblock-cycle-upright50 div.slide-inner img {height:303px;
margin:0 !important;
padding:0 !important;
width:496px;
}
and
div.ddblock-cycle-upright50 div.custom-pager img {border:medium none;
height:30px;
padding:0 3px 0 0 !important;
vertical-align:middle;
width:40px;
}
Further set the container width to 496px:
div.ddblock-cycle-upright50 div.container {background-color:#FFFFFF;
width:496px;
}
Hope this helps you further
#14
adding the !important in where you said to, did not change anything.
do you have any
other suggestions ??
#15
The theme looks ok now for me. (maybe you have to do a shift reload in your browser)
For the readme button you have to do what I said in #11.
Uncheck the checkbox in front of the next setting in the configuration page of the block.
Hope this helps
#16
Will have a look why your pager is not working. It doesn't go to the next slide.
#17
yes! thank you very much!
which setting allows the pager item to be clicked once to bring the slide up?
right now, clicking the slide read more takes me to node, but clicking the pager button reloads the front page...
thank you again so so much for helping me today and before
#18
Which version of the module you use?
You have version 6.x-1.x-dev in the version of the issue but I don't think you use this version.
#19
Can you set the pager-container setting under pager settings in the block configuration page to:
.custom-pager-itemDon't forget the dot in front of custom-pager-item
#20
i have RC4, i am putting .custom-pager-item in now, ...
#21
i can't tell you how greatful i am.
i have been obsessed with getting this to work since two days ago. i mean obsessed.
you have helped so much.
I want you to know how awesome you are!
you are the best!
thank you !!
#22
Congratulations!!!
You managed to install and configure the module
Looks good!!!
Just play with the settings in the configuration page to learn to know the possibilities of the module.
Only adding a
margin: 0 !important;Edit:
to the custom-pager img
so it becomes
div.ddblock-cycle-upright50 div.custom-pager img {border:medium none;
height:30px;
margin:0 !important;
padding:0 3px 0 0 !important;
vertical-align:middle;
width:40px;
}
would make the pager look a little bit nicer
#23
i'm not sure if this changed anything but if it did it split the text in two lines akwardly, anyways.
its alright i will figure all this out,
you are truely the best and this mod is so great! taking drupal display to next level. thank you very much
#24
Thanks for your nice words.
Looks ok in FF3, IE7 and Chrome on my computer
#25
Hi everybody, I'm having the same problem and can't resolve it. I followed the tutorial step by step on a fresh installation and using the news item type and views on garland and a custom theme obtaining an unformatted views list of the items. Could anybody help me please? I really need this module...
the test site is: testing.davidepace.com
thanks in advanced
#26
Please upgrade to RC5 of the module.
The theme and template files on http://ddblock.myalbums.biz only work for version RC5 of the module.
I dont see ddblock functionality on your testsite.
I think you still need to make a ddblock instance of your views block and place this block on your page and not the views block itself.
Follow the advanced dynamic display block tutorial on http://ddblock.myalbums.biz.
Hope this helps you further.
If not please make another issue for version RC5 of the module.
#27
thank you very much!!! now works properly...
#28
set status to fixed
#29
Automatically closed -- issue fixed for 2 weeks with no activity.