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
Description

When i drag mouse to thumb images then tootip show " navigate to top".
I want change to $node->title.
i have change <?php
print $node->title;
?>
" rel="nofollow">

but it's not show
Please help!

#1

ppblaauw - July 30, 2009 - 10:12
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 report» support request
Status:active» needs review

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

itqn2004 - July 30, 2009 - 08:26

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
print $pager_item['tooltip']
?>
" class="pager-link" rel="nofollow">

But tootip not show

#3

ppblaauw - July 30, 2009 - 10:07

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

itqn2004 - July 30, 2009 - 14:35

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

#5

ppblaauw - July 31, 2009 - 00:23
Status:needs review» fixed

#6

itqn2004 - July 31, 2009 - 03:22

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

ppblaauw - July 31, 2009 - 03:53

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

#8

System Message - August 14, 2009 - 04:00
Status:fixed» closed

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

#9

cgjohnson - November 13, 2009 - 22:10

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

#10

cgjohnson - November 13, 2009 - 23:01

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

ppblaauw - November 14, 2009 - 01:26
Status:closed» 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.

#12

cgjohnson - December 9, 2009 - 20:57

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

#13

cgjohnson - December 9, 2009 - 20:59

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

ppblaauw - December 10, 2009 - 02:48
Status:postponed (maintainer needs more info)» fixed

Great its working now!!!

set status to fixed

#15

System Message - December 24, 2009 - 02:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.