When i drag mouse to thumb images then tootip show " navigate to top".
I want change to $node->title.
i have change print $node->title; ">Only local images are allowed. print base_path() . $image_file; " alt="" width="55" height="55" />
but it's not show
Please help!

Comments

ppblaauw’s picture

To change the tooltip dynamically in the template you need to create a variable for the template in the pager preprocess function in template.php.

Edit: THIS CODE IS WRONG SEE #3 for the right code
You can add

// add tooltip variable
$vars['pager_item']['tooltip'] = $result->node_title;

In your ddblock template file (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>

Hope this helps you further, please let me know.

itqn2004’s picture

Title: change tootip "navigate to topic " by node title when drag mouse to thumb image in dblock sildeshow » change tooltip "navigate to topic " by node title when drag mouse to thumb image in ddblock slideshow
Category: bug » support
Status: Active » Needs review

i have add to template.php
function jocmedia_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('

' . var_export($vars['pager_settings'], true) . '

');
// drupal_set_message('

' . var_export($vars['content'][0], true) . '

');
if ($vars['pager_settings']['view_name'] == 'view_td') {
if (!empty($vars['content'])) {
foreach ($vars['content'] as $key1 => $result) {
// add pager_item_image variable
if (isset($result->node_data_field_img_field_img_fid)) {
$fid = $result->node_data_field_img_field_img_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,
$result->node_title);
}
else {
$pager_items[$key1]['image'] =
'Only local images are allowed. '" alt="' . $result->node_title .
'"/>';
}
}
// add tooltip variable

// add pager_item _text variable
if (isset($result->node_teaser)) {
$pager_items[$key1]['text'] = $result->node_teaser;
}
}
}
$vars['pager_items'] = $pager_items;
$vars['pager_item']['tooltip'] = $result->node_title;
}
}
}

and change to file ddblock-cycle-block-content-upright40.tpl
print $pager_item['tooltip']" class="pager-link"> print $pager_item['image'];

But tootip not show

ppblaauw’s picture

Code in the preprocess function needs to be:

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

The code needs to be added inside the foreach statement

I used a newer template.php file by mistake, sorry.

Hope this helps you further, please let me know.

itqn2004’s picture

oh, it's works.
Thank you very much.

ppblaauw’s picture

Status: Needs review » Fixed
itqn2004’s picture

Sorry, when i see on ie 7 then tootip not show , it's show on firefox. Anh when word title in " " then title not show
can fix with ie .

ppblaauw’s picture

The tooltip should also show in IE7.
Do you have a link to your Internet site?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

cgjohnson’s picture

I want to change what appears on hover instead of "Navigate to Topic" -- any help?

cgjohnson’s picture

Tried these steps and it does not show. It did remove the "navigate to topic", wqhich is a start but it's not showing the title on hover. thanks.

ppblaauw’s picture

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

#10

Like said before:
The follwing code needs to be added in the preprocess function: jocmedia_preprocess_ddblock_cycle_pager_content needs to be

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

The code in the pager template file:

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

Hope this helps you further, please let me know.

If not, can you send the template.php file and the pager template file of the theme you use, so I can help you better.

cgjohnson’s picture

Thank you, adding this did fix it. I'm sorry I missed that the first time round.

cgjohnson’s picture

Actually, that's not the whole truth. I subbed the pager item text field for the tooltip, and have our editors add a shortened title to the pager item text field, which displays on hover. Worked like a charm.

ppblaauw’s picture

Status: Postponed (maintainer needs more info) » Fixed

Great its working now!!!

set status to fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.