change tooltip "navigate to topic " by node title when drag mouse to thumb image in ddblock slideshow
itqn2004 - July 30, 2009 - 04:24
| Project: | Dynamic display block |
| Version: | 6.x-1.0-rc6 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
When i drag mouse to thumb images then tootip show " navigate to top".
I want change to $node->title.
i have change <?php" rel="nofollow">
print $node->title;
?>
but it's not show
Please help!

#1
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.
#2
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'] =
'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
<?php" class="pager-link" rel="nofollow">print $pager_item['tooltip']
?>
<?phpprint $pager_item['image'];
?>
But tootip not show
#3
Code in the preprocess function needs to be:
<?php// 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.
#4
oh, it's works.
Thank you very much.
#5
#6
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 .
#7
The tooltip should also show in IE7.
Do you have a link to your Internet site?
#8
Automatically closed -- issue fixed for 2 weeks with no activity.
#9
I want to change what appears on hover instead of "Navigate to Topic" -- any help?
#10
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.
#11
#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.
#12
Thank you, adding this did fix it. I'm sorry I missed that the first time round.
#13
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.
#14
Great its working now!!!
set status to fixed
#15
Automatically closed -- issue fixed for 2 weeks with no activity.