• When hovering the pager items a tooltip is shown. This is standard the tooltip "navigate to topic". To change the tooltip dynamically in the node title, you need to have a variable for the tooltip in the ddblock template file of the ddblock theme you use. You need to create this variable for the template file in the pager preprocess function in template.php.

    You need to add the following code to the pager preprocess function:
    [theme_name]_preprocess_ddblock_cycle_pager_content in the template.php file, inside the "for each" loop:

          // add tooltip variable
          $pager_items[$key1]['tooltip'] =  $result->node_title;

    In your ddblock template file : ddblock-cycle-pager-content-[ddblock-theme-name].tpl.php (I used upright50 as an example) you can now use:

          <a href="#" title="<?php print $pager_item['tooltip']?>" class="pager-link"><?php print $pager_item['image']; ?><?php print $pager_item['text']; ?></a>

    instead of

          <a href="#" title="navigate to topic" class="pager-link"><?php print $pager_item['image']; ?><?php print $pager_item['text']; ?></a>

    3, Click the tip link to add or view comments
  • To link the image in the slide to the node you can use the l() function like below:

    l($text, $path, $options = array())

    if ($vars['imgcache_slide'] <> '<none>' && module_exists('imagecache') &&  is_array(imagecache_presets())){
      $slider_items[$key1]['slide_image'] = 
      l(theme('imagecache', 
              $vars['imgcache_slide'], 
              $filepath,
              check_plain($result->node_title)),                  
        'node/' . $result->nid,
        array('html' => TRUE,) // needed, Whether the title is HTML, or just plain-text. TRUE for HTML
      );
    }
    else {          
      $slider_items[$key1]['slide_image'] = 
      l('<img src="' . base_path() . $filepath . '" alt="' . check_plain($result->node_title) . '"/>',                  
        'node/' . $result->nid,
        array('html' => TRUE,) // needed, Whether the title is HTML, or just plain-text. TRUE for HTML
      );
    }          

    9, Click the tip link to add or view comments
    1. In template.php of the theme, in the function mytheme_preprocess_views_slideshow_ddblock, after this line:
      $slider_items[$key1]['slide_node'] = base_path() . 'node/' . $result->nid;

      Add the following code, to add the node id as a template variable:
      $slider_items[$key1]['slide_nid'] = $result->nid;
    2. In views-slideshow-ddblock-cycle-block-content-[slideshow_theme_name].tpl.php print the node by adding these lines:
      <?php
          $node= node_load($slider_item['slide_nid']);
          print node_view($node);
      ?>

    This snippet is made by: MMusashi

    0, Click the tip link to add or view comments
  • To display the widget in the slideshow you can use the following php code in the ddblock-cycle-pager-content-[theme_name].tpl.php content template file of the ddblock theme:

    <div class="plus1-widget">
    <?php
     print plus1_jquery_widget($slide_node,0,0);
    ?>
    <div>

    This can e.g. be added to the slidetext <div>

    To deliver the $node object in the variable $slide_node to the template file you need to add the following snippet to the content preprocess function:

    // add $node object 
    $slider_items[$key1]['slide_node'] =  node_load($result->nid);

    0, Click the tip link to add or view comments
  • Instead of checking the slide_text with check_plain()

    // add slide_text variable
    if (isset($result->node_data_field_pager_item_text_field_slide_text_value)) {
      $slider_items[$key1]['slide_text'] =  check_plain($result->node_data_field_pager_item_text_field_slide_text_value);
    }

    use check_markup()

    // 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);
    }

    0, Click the tip link to add or view comments
  • In case you enabled the description of the image field and want to use this description e.g. for the slide_text you can use the code below.

    //  add slide_text variable from imagefield description
    if (isset($result->[image_field]_data)) {
      $data=unserialize($result->[***image_field***]_data);
      if (isset($data['description'])) {
        $slider_items[$key1]['slide_text'] = $data['description'];
      }
    }

    1. Find the CCK generated [***image_field***] name with the debug lines
    2. Change [***image_field***] with the CCK generated name

    Comments:

    In this case only the imagefield is added in the view. Automatically also the serialized data of the imagefield is added. To get the description from the serialized data the data has to be unserialized.

    1, Click the tip link to add or view comments
  • The l() function in Drupal 6 uses an $options array where you can pass a fragment.

    'fragment' - A fragment identifier (named anchor) to append to the link. Do not include the '#' character.

    To split the named anchor from your original URL you can use:

    explode('#',$result->node_data_field_pager_item_text_field_url_value)

    The code, including an if statement to check if the URL has a named anchor part,would become:

    // add slide_read_more variable
    if (isset($result->node_data_field_pager_item_text_field_url_value)) {
      if (stristr($result->node_data_field_pager_item_text_field_url_value,'#')) {
        $split_url = explode('#',$result->node_data_field_pager_item_text_field_url_value);
        $slider_items[$key1]['slide_read_more'] =  l('Read more...', $split_url[0], array('fragment' => $split_url[1],));
      } 
      else {
        $slider_items[$key1]['slide_read_more'] =  l('Read more...', $result->node_data_field_pager_item_text_field_url_value);
      }
    }

    Also have a look at the related how to: How to link Read more... button to another page instead of the node

    2, Click the tip link to add or view comments
  • When you use the dynamic display block module to showcase events and want to show how long till the events starts or show ongoing if the event is happening at this time you can do the following:

    Add a date field to CCK with a start date and an end date. Add this field to the view you use and use the following code to make the title in the content preprocess function:

        // add slide_title variable
        if (isset($result->node_title)) {
          date_default_timezone_set('Europe/London');
          $vars['slider_item']['slide_title'] =  $result->node_title .
          '<br />' .
          theme_date_time_ago(date_create($result->node_data_field_pager_item_text_field_startdate_value), date_create($result->node_data_field_pager_item_text_field_startdate_value2));
        }

    0, Click the tip link to add or view comments