?
avatar brianteeman
brianteeman
10 Jun 2015

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?

avatar brianteeman brianteeman - open - 10 Jun 2015
avatar brianteeman brianteeman - change - 10 Jun 2015
Build 3.4.1 staging
avatar brianteeman brianteeman - change - 10 Jun 2015
Build 3.4.1 staging
avatar brianteeman brianteeman - change - 10 Jun 2015
Labels Added: ?
avatar brianteeman brianteeman - change - 10 Jun 2015
The description was changed
avatar infograf768
infograf768 - comment - 10 Jun 2015

Yes.

avatar infograf768
infograf768 - comment - 10 Jun 2015

There is a possible solution to get it back:
screen shot 2015-06-10 at 11 27 47

avatar brianteeman
brianteeman - comment - 10 Jun 2015

And what is that solution?

avatar infograf768
infograf768 - comment - 10 Jun 2015

I guess using JQuery to inject in the input the class and title

avatar Bakual
Bakual - comment - 10 Jun 2015

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.

avatar brianteeman
brianteeman - comment - 10 Jun 2015

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#L37

By 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/

avatar Bakual
Bakual - comment - 10 Jun 2015

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.

avatar brianteeman
brianteeman - comment - 11 Jun 2015

I guess an easy option would be to replace the tooltip on the search button which just says Search with the more informative tooltip??


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7146.

avatar infograf768
infograf768 - comment - 11 Jun 2015

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."

screen shot 2015-06-11 at 11 55 02

avatar Bakual
Bakual - comment - 11 Jun 2015

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.

avatar Bakual
Bakual - comment - 11 Jun 2015

Have a look at PR #7150 if that solves this issue.

avatar zero-24
zero-24 - comment - 11 Jun 2015

Closing as we have a Pull Request by @Bakual #7150

avatar zero-24 zero-24 - change - 11 Jun 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-06-11 11:52:18
Closed_By zero-24
Build master staging
avatar zero-24 zero-24 - close - 11 Jun 2015

Add a Comment

Login with GitHub to post a comment