Hello,

I am trying a simple tooltip task and it's so hard!
The documents arn't very helping and I cant figure out how to do so.

What I am trying is to add a tooltip to a "?" image displaying on a node (will be best to render through page--front.tpl.php).
So I have created a BeautyTips Custom-Tip using the UI.
I have added a div in the page--front.tpl.php showing an image with an alt text (The tooltip text I guess).
Then I have reached the templete.php part which I didn;t really understand.

I have added:

  if (module_exists('beautytips') ) {
    $options['bt_drupal_help_page'] = array(
       'cssSelect' => '.help-items li a',
       'ajaxPath' => array(0 => "$(this).attr('href')", 1 => '.clear-block p'),
       'trigger' => array(0 => 'mouseover', 1 => 'click'),
       'width' => 350,
     );
     beautytips_add_beautytips($options); 
  }

But couldnt figure the way to config it properly.

thanks fo the help.

Amir

Comments

mxt’s picture

I'm interested in this too.

BeautyTips API description in readme.txt describe how to write the array, but doesn't describe WHERE and HOW put the code to obtain a single tooltip on a single element in a defined page.

So, if in my page I have an element with an id, for example:

<p id="my-element">.....</p>

What I have to do to attach a tooltip on it?

Thank you very much.

stephenh’s picture

Correct me if I am wrong, but what you are trying to achieve can be done solely through the Beauty Tips Custom Tips UI (Configuration>User Interface>BeautyTips>BeautyTips Custom-Tips>BeautyTips Custom-Tip Add). There shouldn't be any need for custom code. All you have to do is add the ID/Class of the element you are targeting to the Element field in the UI and you should be good to go.

Please let me know if this answers your question.

mxt’s picture

This works in admin pages also? I have to attach a beautytip to a checkbox in a node/add input checkbox.

stephenh’s picture

Status: Active » Fixed

Hi MXT,

Yeah - it works on admin pages. Create a Custom BeautyTip via the BeautyTips Custom-Tips UI following the same steps I outlined above. Just make sure that the path of the page you are displaying the BeautyTip on (i.e. mysitebasepath/node/add/article) is not excluded via the Show beautytip on specific pages section.

Hope this helps.

Status: Fixed » Closed (fixed)

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