0

I would like to use the Bootstrap PopOver (http://getbootstrap.com/2.3.2/javascript.html#popovers) in the backend of my component.

Well, the Tooltips already work by using:

echo JHTML::_('tooltip','test','','','Test');

But the popovers do not work this way. Could somebody help me out?

tereško
  • 58,060
  • 25
  • 98
  • 150
user3755325
  • 79
  • 1
  • 2
  • 9
  • Did you check that: http://stackoverflow.com/questions/11947094/twitter-bootstrap-popovers-not-working-for-dynamically-generated-content?rq=1 ? – Ramy Nasr Jul 29 '14 at 15:32
  • Have you checked the [Joomla API](http://api.joomla.org/cms-3/classes/JHtmlBootstrap.html#method_popover) for popovers? @Ramy, Joomla supports Bootstrap popovers using the API, no need to manually do it with JS ;) – Lodder Jul 29 '14 at 15:35
  • I'm using Joomla 3.3.3 I read http://api.joomla.org/cms-3/classes/JHtmlBootstrap.html#method_popover, but I do not know how to apply that on my component. Maybe you can give me a hint how to use this with JHtml? I thought it would be like the way I described above, but I'm getting the error "JHtml::popover not found". – user3755325 Jul 29 '14 at 15:39
  • Can you please provide the code you actually using for the popover in your question? – Lodder Jul 29 '14 at 15:40
  • Hi Lodder, i tried it this way: `// Get BootStrap Framework JHtml::_('bootstrap.framework');` and `echo JHTML::_('popover','test','','','Test');` But this does not work. `echo JHTML::_('tooltip','test','','','Test');` works fine. – user3755325 Jul 29 '14 at 15:50

1 Answers1

0

You first need to initiate the popover js file like so:

JHtml::_('bootstrap.popover');

You can then use the following HTML markup which calls the popup:

<small class="hasPopover" data-placement="top" title="Header" data-content="Content">Hover over me</small>

Hope this helps

Lodder
  • 19,758
  • 10
  • 59
  • 100
  • Great - thank you. That helps a lot. I thought it would be possible to echo it via JHTML like in my tooltip-example. Is there any possibility to show the popover on mouse click? – user3755325 Jul 29 '14 at 15:59