User tests: Successful: Unsuccessful:
Pull Request for Issue # .
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.
blog
and see the results.When there are no results add a link to search again
When there are results add a link to jump to the results. Just like a skip-link
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_finder Front End Language & Strings |
Title |
|
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?
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
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');
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?)
Labels |
Added:
?
?
|
@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>."
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>
@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>
I have tested this item
@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.
I have tested this item
I have tested this item
Works as shown in "Expected result AFTER applying this Pull Request".
I have tested this item
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:
?
|
Thanks!
what about giving the message a role="alert" ? that way it should result in the number of results being announced immediately on page load