I'd like to know if I can use BeautyTips to display text from webpages, specifically, Drupal book pages (i.e. not necessarily an .html file)...
If this is possible, what's the syntax?
I'd like to know if I can use BeautyTips to display text from webpages, specifically, Drupal book pages (i.e. not necessarily an .html file)...
If this is possible, what's the syntax?
Comments
Comment #1
kleinmp commentedYes, that is possible. For example, if you have the popup loading over a link with class 'example':
So, '$(this).attr("href")' grabs the link 'href' attribute from the link. Then, it places the content contained in '#id.example p' from the other page into the popup. You probably don't want an entire page Drupal book page displayed in the popup, so it's a good idea to just select what you need from that page.
You should also be able to hard link a page that doesn't end in .html. (Use 'ajaxPath' => array(http://www.example.com/example, '#id.example p')).
Comment #2
Anonymous (not verified) commentedI can't get it to work...
I want a hard-coded link, so am trying to use the following code:
My book page is located at: http://localhost/drupal/my_help
Using the above code, I'm not even getting the 'loading' or 'error' popups; I'm not getting any popup at all...
Comment #3
kleinmp commentedI would check if the beautytip is being added to the page element #my_field. If beautytips is recognizing it, then an attribute called bt_title will be added to #my_field.
Also, what file are you calling beautytips_add_beautytips($options); from? Note that If you call it from template_page_preprocess, then it is too late to add the jquery. At that point all javascript has already been added.
Comment #4
Anonymous (not verified) commentedThis is the code for #my_field:
<input id="my_field" class="bt-active" type="text" title="" bt-xtitle="title text"/>I've put both the field code and PHP code in a page node, set to the PHP input format, but still no luck...
Comment #5
Anonymous (not verified) commentedIt works when I comment out the 'ajaxPath' line (it shows the title text in the popup), so BeautyTips is working.
It just doesn't seem to like something in
'ajaxPath' => array('http://localhost/drupal/my_help'),...Any ideas?
Comment #6
kleinmp commentedTry doing this instead of using an array
'ajaxPath' => '/my_help',or if there's a particular place on that page that you're trying to grab:
'ajaxPath' => '/my_help #example-id',I haven't tested it too much, but it doesn't seem to like a full site url in this way.
Comment #7
Anonymous (not verified) commentedThanks kleinmp, that worked!
For the record, I had to add
/drupalto the beginning of the URL for it to work on my setup, and I was even able to go back to using the full URL:'ajaxPath' => 'http://localhost/drupal/my_help #example-id',.There must have just been an issue with setting it as an array...