? ? ? Pending

User tests: Successful: Unsuccessful:

avatar hans2103
hans2103
1 Sep 2020

Pull Request for Issue # .

Summary of Changes

With this PR I've added the total amount of search results and a link to the search results.
I am missing a statement about how many search results were found. I only get this information when no results are found.
When search results are found I would like to be able to click on it and jump directly to the results.

Testing Instructions

  • Search for blog and see the results.

Actual result BEFORE applying this Pull Request

Schermafbeelding 2020-08-18 om 15 18 52

Expected result AFTER applying this Pull Request

screenshot 1

When there are no results add a link to search again
Schermafbeelding 2020-08-18 om 15 58 50

screenshot 2

When there are results add a link to jump to the results. Just like a skip-link
Schermafbeelding 2020-08-18 om 15 57 57

avatar hans2103 hans2103 - open - 1 Sep 2020
avatar hans2103 hans2103 - change - 1 Sep 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Sep 2020
Category Administration com_finder Front End Language & Strings
avatar hans2103 hans2103 - change - 1 Sep 2020
Title
add statement on found results
[4.0] [a11y] add statement on found results
avatar hans2103 hans2103 - edited - 1 Sep 2020
avatar brianteeman
brianteeman - comment - 1 Sep 2020

what about giving the message a role="alert" ? that way it should result in the number of results being announced immediately on page load

avatar hans2103
hans2103 - comment - 1 Sep 2020

what about giving the message a role="alert" ? that way it should result in the number of results being announced immediately on page load

just wrote a new issue
#30536

@brianteeman I see you write role=alert while I was thinking about role=status
Which one is better?

avatar brianteeman
brianteeman - comment - 1 Sep 2020

You cant use status as that is for live regions ie parts of the page that are updated
In our case the page is reloaded and not updated

avatar hans2103
hans2103 - comment - 1 Sep 2020

thank you.

what about giving the message a role="alert" ?

Do you mean something like this:

$text = "no results OR one result OR x amount of results"
Factory::getApplication()->enqueueMessage($text, 'alert');
avatar brianteeman
brianteeman - comment - 1 Sep 2020

Sorry I used the word message incorrectly - i think

You can just put the role on the existing element - you dont need to use the enqueMessage as that creates a message at the top of the page (doesnt it?)

avatar hans2103 hans2103 - change - 1 Sep 2020
Labels Added: ? ?
avatar hans2103
hans2103 - comment - 1 Sep 2020

@brianteeman I've added role=alert to the announcement of search results. It had to be added to the language strings.

COM_FINDER_QUERY_RESULTS="the following <a href=\"#search-result-list\" role=\"alert\">%s results were found</a>."
COM_FINDER_QUERY_RESULTS_0="<span role=\"alert\">no results were found</span>. <a href=\"#q\">Search again</a>."
COM_FINDER_QUERY_RESULTS_1="the following <span role=\"alert\">%s result was found</span>."
avatar brianteeman
brianteeman - comment - 1 Sep 2020

thats not going to work and its also not good practice to put markup inside a language string

this should work (not tested as I'm on my phone) . replace div if needed with any block element

<?php // Display the explained search query. ?>
		<div role="alert">
			<?php echo Text::sprintf('COM_FINDER_QUERY_TOKEN_INTERPRETED', $this->explained, Text::plural('COM_FINDER_QUERY_RESULTS', $this->total)); ?>
		</div>

avatar hans2103
hans2103 - comment - 1 Sep 2020

@brianteeman thank you for the feedback.
I've placed the text displayed in id="search-query-explained" in a paragraph element.

Assuming blog is required, the following 5 results were found.

<p role="alert">Assuming <span class="query-required"><span class="term">blog</span> is required</span>, the following <a href="#search-result-list">5 results were found</a>.</p>
avatar paternax paternax - test_item - 1 Sep 2020 - Tested successfully
avatar paternax
paternax - comment - 1 Sep 2020

I have tested this item successfully on 6eca68f


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

avatar hans2103
hans2103 - comment - 1 Sep 2020

@Quy and @brianteeman thank you for your contributions. I did some tests with plural to prevent the double strings. But it failed on my test. Now it seems to work and that makes me happy.
I have applied the suggested commits from @Quy.

avatar Quy
Quy - comment - 1 Sep 2020

@hans2103 There is a Commit suggestion button under the Suggested change code.

avatar hans2103
hans2103 - comment - 1 Sep 2020

@Quy thank you.. I was trying to merge the suggestions through the overview of changed files. But that didn't stick.
Now it seems to work. Thank you

avatar paternax paternax - test_item - 1 Sep 2020 - Tested successfully
avatar paternax
paternax - comment - 1 Sep 2020

I have tested this item successfully on 709eb8b


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

avatar Formatio-hippocampi Formatio-hippocampi - test_item - 2 Sep 2020 - Tested successfully
avatar Formatio-hippocampi
Formatio-hippocampi - comment - 2 Sep 2020

I have tested this item successfully on f7c9996

Works as shown in "Expected result AFTER applying this Pull Request".


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

avatar paternax paternax - test_item - 2 Sep 2020 - Tested successfully
avatar paternax
paternax - comment - 2 Sep 2020

I have tested this item successfully on f7c9996


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

avatar wilsonge wilsonge - change - 2 Sep 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-09-02 09:08:04
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 2 Sep 2020
avatar wilsonge wilsonge - merge - 2 Sep 2020
avatar wilsonge
wilsonge - comment - 2 Sep 2020

Thanks!

Add a Comment

Login with GitHub to post a comment