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;
    }
  }    
}
CommentFileSizeAuthor
#4 themeregistery.txt128.1 KBToktik

Comments

Toktik’s picture

I 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.

Toktik’s picture

The CSS call's normal, I think.

<link type="text/css" rel="stylesheet" media="all" href="/web/sites/all/themes/agnian/custom/modules/ddblock/upright10/ddblock-cycle-upright10.css?m" />

And here Javascript call.

<script type="text/javascript" src="/web/modules/ddblock/js/ddblock.js?m"></script>

And here HTML code

<!-- Region: Footer -->
<div id="footer-region" class="clearfix">
<span id="thmr_56" class="thmr_call">
  <span id="thmr_109" class="thmr_call">
  <div id="block-ddblock-3" class="clear-block block block-ddblock">

  <h2>ddblock-News item slideshow</h2>

  <div class="content"><span id="thmr_107" class="thmr_call">
  <!-- dynamic display block slideshow -->

<div id="ddblock-3" class="ddblock-cycle-upright10 clear-block">
 <div class="container clear-block border">
  <div class="container-inner clear-block border">
      <!-- slider content -->
   <div class="slider clear-block border">
    <div class="slider-inner clear-block border">
                    </div> <!-- slider-inner-->
   </div>  <!-- slider-->

       <!-- number pager --> 
    <span id="thmr_108" class="thmr_call">
   <div class="spacer-horizontal"><b></b></div>
<!-- number pager -->
<div id="ddblock-number-pager-3" class="number-pager ddblock-pager clear-block">
</div> 
<div class="number-pager-pre-bottom "></div>
</span>

     </div> <!-- container-inner-->
 </div> <!--container-->

</div> <!--  template -->
</span>

</div>
  </div></span>

</span>

</div>

My theme is upright10, the file "ddblock-cycle-block-content-upright10.tpl.php" is default, not modified.

Any ideas?

ppblaauw’s picture

I 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.

Toktik’s picture

StatusFileSize
new128.1 KB

FAQ 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.

ppblaauw’s picture

If 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?

Toktik’s picture

Yes it is created in the theme. In the template.php only ddblock preprocess functions.

ppblaauw’s picture

Status: Active » Postponed (maintainer needs more info)

I 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.

Toktik’s picture

Same problem with garland :( No debug output.

ppblaauw’s picture

I 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?

Toktik’s picture

drupal_set_message. no output :(

I send you site address to email.

ppblaauw’s picture

I don't see a dynamic display block on the site, can you put the ddblock block you made in one of the regions.

Toktik’s picture

Sorry, I forget about user permissions. The block is in footer! :) Now is ok! check it :)

ppblaauw’s picture

Ok, 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.

Toktik’s picture

template.php i think founds. because if I do syntax error drupal reacts...

ppblaauw’s picture

Could you add the following lines at the top of the content preprocess function in your template.php file

    drupal_set_message('<pre>' . var_export($vars['settings']['view_name'], true) . '</pre>');
    drupal_set_message('<pre>' . var_export($vars['content'][0], true) . '</pre>');

Before the if statment

Toktik’s picture

Works :) Slideshow now displayed, but no picture, check it please. But why, when I add the debug functions before if, the slideshow now displayed! why?

    *

      'news_items'

    *

      stdClass::__set_state(array(
         'nid' => '13',
         'node_title' => '01',
         'node_data_field_pager_item_text_field_pager_item_text_value' => 'Page text',
         'node_type' => 'ddblock_news_item',
         'node_vid' => '13',
         'node_data_field_pager_item_text_field_slide_text_value' => 'Slide text. HERE!',
         'node_data_field_pager_item_text_field_image_fid' => '12',
         'node_data_field_pager_item_text_field_image_list' => '1',
         'node_data_field_pager_item_text_field_image_data' => 'a:3:{s:11:"description";s:0:"";s:3:"alt";s:0:"";s:5:"title";s:0:"";}',
         'node_revisions_body' => 'dgdh',
         'node_revisions_format' => '1',
         'node_created' => '1239734730',
      ))
Toktik’s picture

Now all is displaying, except image. Whats the problem? And second question. How to set another image size for upright10 theme?

ppblaauw’s picture

You need to change (4x) in the preprocess functions the image fieldname

..._fid

to

node_data_field_pager_item_text_field_image_fid

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.

Toktik’s picture

Works! :) Thank you very much for helping me :)

ppblaauw’s picture

Assigned: Toktik » Unassigned
Status: Postponed (maintainer needs more info) » Fixed

Set status to fixed

Toktik’s picture

Status: Fixed » Active
Toktik’s picture

Status: Active » Fixed

There are issue in first message. In second function, in
if ($vars['output_type'] == 'views_fields') {

views_fields, should be view_field.

Toktik’s picture

Status: Fixed » Active

I 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?

    *

      'news_items'

    *

      stdClass::__set_state(array(
         'nid' => '29',
         'node_title' => 'testslidetitle',
         'node_data_field_pager_item_text_field_pager_item_text_value' => 'testslidepageritemtext',
         'node_type' => 'ddblock_news_item',
         'node_vid' => '29',
         'node_data_field_pager_item_text_field_slide_text_value' => 'testslidetext',
         'node_revisions_body' => '',
         'node_revisions_format' => '1',
         'node_created' => '1241871141',
      ))
ppblaauw’s picture

Status: Active » Postponed (maintainer needs more info)

As 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.

Toktik’s picture

In 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"

Toktik’s picture

No ideas? I think, reinstall will help. :)

ppblaauw’s picture

The 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

Toktik’s picture

ok, now I'm reinstalling ddblock from scratch, if problem will exist, I will inform you.

ppblaauw’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Set status to closed, 10 weeks without activity.
See ddblock works at posters site.

suncanoe’s picture

Status: Closed (fixed) » Active

I have the same problem, How are you to resolve this problem?
can you give a whole resolve solution?

ppblaauw’s picture

Status: Active » Postponed (maintainer needs more info)

#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.