Override grid CSS hasPopover class at front end

58 views
Skip to first unread message

Thierry CHEN

unread,
Oct 1, 2019, 2:42:22 AM10/1/19
to Joomla! General Development
Hi,

I use JHTML::_('grid.sort') at front-end in a component. Since 3.9 upgrade popups over front titles lost their styling. It appears that CSS class "hasTooltip" has been changed for "hasPopover".

If I change the libraries/cms/html/grid.php :

$html = '<a href="#" onclick="Joomla.tableOrdering(\'' . $order . '\',\'' . $direction . '\',\'' . $task . '\'' . $form . ');return false;"' . ' class="hasPopover" title="' . htmlspecialchars(JText::_($tip ?: $title)) . '"'
 
. ' data-content="' . htmlspecialchars(JText::_('JGLOBAL_CLICK_TO_SORT_THIS_COLUMN')) . '" data-placement="top">';


to

$html = '<a href="#" onclick="Joomla.tableOrdering(\'' . $order . '\',\'' . $direction . '\',\'' . $task . '\'' . $form . ');return false;"' . ' class="hasTooltip" title="' . htmlspecialchars(JText::_($tip ?: $title)) . '"'
 
. ' data-content="' . htmlspecialchars(JText::_('JGLOBAL_CLICK_TO_SORT_THIS_COLUMN')) . '" data-placement="top">';

the front end popups when mouse hovers titles looks correct again.

How can I do that cleanly without changing core code and be shure that I will not have to change it again at next release ?

brian teeman

unread,
Oct 2, 2019, 1:14:28 PM10/2/19
to Joomla! General Development
that file has not been changed for a very long time. https://github.com/joomla/joomla-cms/commits/staging/libraries/cms/html/grid.php

Michael Babker

unread,
Oct 2, 2019, 1:51:54 PM10/2/19
to joomla-de...@googlegroups.com
Use JHtml::register() to register custom callbacks.  Use this carefully.

With that said though, it seems your template's CSS did not actually support both tooltips and popovers (IIRC both are based on the corresponding Bootstrap components), so maybe you should look into updating the template.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/joomla-dev-general/1037f786-11a8-4c08-98e3-aee53edbd1fb%40googlegroups.com.

Thierry CHEN

unread,
Oct 3, 2019, 6:33:51 AM10/3/19
to Joomla! General Development
My old template is probably not up to date about Bootstrap but I don't like the idea to maintain two types of tooltips CSS so I'll use your plugin system. Thanks.

And what about defining the correct path to the icons ? The line

                    $html .= '<span class="icon-' . $icon[$index] . '"></span>';

does not load the icons.
Do you now what will be the Joomla's design in future about that subject, keeping double tooltip system or move completely to Bootstrap ?
Reply all
Reply to author
Forward
0 new messages