While answering a support request about using the filter search in the admin and menu manager I realised that the strings
COM_CONTENT_FILTER_SEARCH_DESC="Search title or alias. Prefix with ID: to search for an article ID."
COM_MENUS_ITEMS_SEARCH_FILTER="Search title or alias. Prefix with ID: to search for a menu ID."
Are never being displayed
Looking at the relevant code it should be
< input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('COM_MENUS_ITEMS_SEARCH_FILTER'); ?>" />
Is this something to do with the switch to using a layout?
Build | 3.4.1 | ⇒ | staging |
Build | 3.4.1 | ⇒ | staging |
Labels |
Added:
?
|
And what is that solution?
I guess using JQuery to inject in the input the class and title
The issue is that our JForm adds the tooltip to the label, but we don't have labels in our searchtools and thus no tooltips are shown. We would need to add them to the input elements.
However as those are generated by the individual JFormFields the simplest solution would probably be to add a span
around the input which contains the tooltip.
You could use <?php echo JText::_($filters['filter_search']->description); ?> to add the description text to the element. Assuming a description is defined in the XML (https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/models/forms/filter_articles.xml#L4), which in this case is missing.
The search input is generated in this JLayout: https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/searchtools/default/bar.php#L37
By the way, a similar issue exists for the other searchtool filters as well. No labels and tooltips are present there.
YEs I realised that it was not being displayed in all the searchtools and
in Hathor which uses an override
On 10 June 2015 at 12:09, Thomas Hunziker notifications@github.com wrote:
The issue is that our JForm adds the tooltip to the label, but we don't
have labels in our searchtools and thus no tooltips are shown. We would
need to add them to the input elements.
However as those are generated by the individual JFormFields the simplest
solution would probably be to add a span around the input which contains
the tooltip.You could use <?php echo JText::_($filters['filter_search']->description);
?> to add the description text to the element. Assuming a description is
defined in the XML (
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/models/forms/filter_articles.xml#L4),
which in this case is missing.The search input is generated in this JLayout:
https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/searchtools/default/bar.php#L37By the way, a similar issue exists for the other searchtool filters as
well. No labels and tooltips are present there.—
Reply to this email directly or view it on GitHub
#7146 (comment).
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
I'm not sure what the best approach is. Adding spans around a form element just to be able to add a tooltip sounds hacky to me. But I don't know a better (easy) way currently.
I think the tooltip could also be created using JavaScript directly, but I'm not a JS guru and I'd prefer to use our API.
I guess an easy option would be to replace the tooltip on the search button which just says Search with the more informative tooltip??
That tooltip is also present in the layout
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>">
string is:
JSEARCH_FILTER_SUBMIT="Search"
Only way I see to add the right tooltip on the button would be to override that string in the component by adding (for example in en-GB.com_content.ini)
JSEARCH_FILTER_SUBMIT="Search title or alias. Prefix with ID: to search for an article ID."
We could use the description specified in the filter form and fall back to JSEARCH_FILTER_SUBMIT in case no description is specified. That would even be B/C.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-06-11 11:52:18 |
Closed_By | ⇒ | zero-24 | |
Build | master | ⇒ | staging |
Yes.