Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...jQuery UI TooltipjQuery UI Tooltip
Previous
 
Next
New Post
2/23/2017 11:05 AM
 

Hi,

I have a strange problem with the jQuery UI tooltip, hopefully someone can help me or point me in the right direction.

HTML-Code:

<p>Lorem ipsum dolor sit amet, <a href="#" title="This is just a meaningless word" data-toggle="tooltip">consetetur</a> sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.</p>

Javascript-Code:

$(document).ready(function () {
   $('[data-toggle="tooltip"]').tooltip();
});

This works as expected. The content of the title attribute is displayed in the tooltip.

But my client wants to have some "richer" tooltips, and I tried to include some HTML code in the title tag.

HTML-Code:

<p>Lorem ipsum dolor sit amet, <a style="background-color: yellow;" data-toggle="tooltip" data-html="true" href="#" title="This is just a meaningless word&lt;br /&gt;It is only blind text.">consetetur</a> sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.</p>

This also works fine, but only using the <br /> tag.

HTML-Code:

<p>Lorem ipsum dolor sit amet, <a data-toggle="tooltip" data-html="true" href="#" title="<ul><li>This is just a meaningless list item.</li><li>This is just another meaningless list item.</li></ul>">consetetur</a> sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.</p>

This results in a tooltip like:

<ul><li>This is just a meaningless list item.</li><li>This is just another meaningless list item.</li></ul>

I tried to find some solutions and found this one:

HTML-Code

<p>Lorem ipsum dolor sit amet, <a data-toggle="tooltip" data-tooltip="<ul><li>This is just a meaningless list item.</li><li>This is just another meaningless list item.</li></ul>" data-html="true" href="#" title="This is just a meaningless word.">consetetur</a> sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.</p>

Javascript-Code:

$(document).ready(function () {
   $('[data-toggle="tooltip"]').tooltip({
      content: function(){
         var toolTipText = $(this).attr("title");
         if (typeof $(this).attr("data-tooltip") !== typeof undefined && $(this).attr("data-tooltip") !== false) {
            toolTipText = $(this).attr("data-tooltip");
         }
         return toolTipText;
      }
   });
});

I tried this last one on some static HTML page, also on fiddler and it worked perfectly. But: When I use this in an HTML module in DNN (8.0.4), it always displays the content of the title tag in the tooltip. I tried:

$(document).ready(function () {
   $('[data-toggle="tooltip"]').tooltip({
      content: function(){
         return "Hello world!";
      }
   });
});

but no changes. I suspected the skin (DnnMDesign), but the same effect was on the Xcillion skin.

Any ideas?

Happy DNNing!
Michael


Michael Tobisch
DNN★MVP

dnn-Connect.org - The most vibrant community around the DNN-platform
 
New Post
2/23/2017 11:27 AM
 
Sorry - this editor is driving me mad sometimes. In the examples above, all the contents of the title tag and the data-tooltip tag should be HTML-encoded.

Happy DNNing!
Michael

Michael Tobisch
DNN★MVP

dnn-Connect.org - The most vibrant community around the DNN-platform
 
New Post
3/1/2017 12:14 PM
 
Anyone?

Happy DNNing!
Michael

Michael Tobisch
DNN★MVP

dnn-Connect.org - The most vibrant community around the DNN-platform
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...jQuery UI TooltipjQuery UI Tooltip


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out