Hi,
How can be enable Bootstrap 5 tooltips style on Joomla (Cassiopeia) template ?
Labels |
Added:
No Code Attached Yet
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-03-08 15:11:03 |
Closed_By | ⇒ | Quy |
Thanks for closing the issue, but the documentation doesn't explain (with examples) for a simple user, how to implement this. You could have given some examples.
@mariantanase where do you want to add tooltips?
@mariantanase where do you want to add tooltips?
Hi @drmenzelit ,
I want to use it inside articles
Then you need to look at the documentation from Bootstrap:
https://getbootstrap.com/docs/5.1/components/tooltips/#examples
Quy showed above how to load tooltips in Joomla.
I know, the bootstrap page I use it everyday on my projects.
Even after inserting references to the bootstrap.bundle javascript file into Cassiopeia, it doesn't work.
If I add that code:
use Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip', '.selector', []);
on index.php, it show an error.
Where does it say to put use
at the beginning
Where does it say to put
use
at the beginning
Thanks @brianteeman !
I had seen in the index.php
that the first lines used "use", and I thought I was using it. Instead you were right.
Using only the:
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip', '.btn', []);
it works fine! Thanks again.
Trust the documentation - its not always wrong
I was too confuoozed. Not sure how it works but it does. To be clear to others, adding a bootstrap component such as TABS looks like this in Cassiopia's index.php override file:
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
\Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tab', '.selector', []);____
Thank you for sharing.
You can just write
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
HTMLHelper::_('bootstrap.tab', '.selector', []);____
as the HTMLHelper class is already defined.
But as I too had to search for that, it remembers me to add it to documentation.
https://docs.joomla.org/J4.x:Using_Bootstrap_Components_in_Joomla_4