Closed (fixed)
Project:
Dynamic display block
Version:
6.x-1.0-rc6
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
30 Jul 2009 at 04:24 UTC
Updated:
24 Dec 2009 at 03:09 UTC
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; ">
print base_path() . $image_file; " alt="" width="55" height="55" />
but it's not show
Please help!
Comments
Comment #1
ppblaauw commentedTo 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:
instead of
Hope this helps you further, please let me know.
Comment #2
itqn2004 commentedi 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('
');
// drupal_set_message('
');
'" alt="' . $result->node_title .
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'] =
'
'"/>';
}
}
// 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
Comment #3
ppblaauw commentedCode in the preprocess function needs to be:
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.
Comment #4
itqn2004 commentedoh, it's works.
Thank you very much.
Comment #5
ppblaauw commentedComment #6
itqn2004 commentedSorry, 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 .
Comment #7
ppblaauw commentedThe tooltip should also show in IE7.
Do you have a link to your Internet site?
Comment #9
cgjohnson commentedI want to change what appears on hover instead of "Navigate to Topic" -- any help?
Comment #10
cgjohnson commentedTried 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.
Comment #11
ppblaauw commented#10
Like said before:
The follwing code needs to be added in the preprocess function: jocmedia_preprocess_ddblock_cycle_pager_content needs to be
The code in the pager template file:
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.
Comment #12
cgjohnson commentedThank you, adding this did fix it. I'm sorry I missed that the first time round.
Comment #13
cgjohnson commentedActually, 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.
Comment #14
ppblaauw commentedGreat its working now!!!
set status to fixed