- 🇩🇪Germany Anybody Porta Westfalica
On the results page, a body class should be added to indicate this is from search404, I think that's a good point!
Changing this into a feature request.
@thomas.frobieter I guess you know which variable has to be modified accordingy?
Something like:
function mymodule_preprocess_html(&$variables) { $variables['attributes']['class'][] = 'the-class-to-add'; }
- First commit to issue fork.
- 🇩🇪Germany Grevil
I am fairly unsure, how to properly set this class on the body (block content), as the form for the search page is being generated inside the controller itself.
We could instead add the class for the "search_form" and "search_results" form elements respectively.
- Open on Drupal.org →Core: 9.5.x + Environment: PHP 7 & MySQL 5.5last update
almost 2 years ago Waiting for branch to pass - @grevil opened merge request.
- Status changed to Needs review
almost 2 years ago 2:44pm 17 May 2023 - 🇩🇪Germany Anybody Porta Westfalica
Nice idea @Grevil, indeed perhaps the better one!
@Nelo_Drup could you please check if that helps?@Grevil should we have a simple test added to check both classes are set in the expected situations?
LGTM from the code perspective so far!
@Nelo_Drup: Please see the issue fork: https://git.drupalcode.org/issue/search404-3172057/-/commit/88f6f2234f24...
- 🇩🇪Germany Anybody Porta Westfalica
And here's the patch as link: https://git.drupalcode.org/project/search404/-/merge_requests/14.diff
- 🇩🇪Germany Grevil
Since there are no functional tests implemented for this module yet, I'd suggest we refer to the test issue, and create the tests there, after these fixes are committed to dev (preferably to a new SemVer Version), WITHOUT creating a new release until the tests are implemented there.
Referring to 📌 Create tests to test this modules functionality Active .
- Open on Drupal.org →Core: 9.5.x + Environment: PHP 7 & MySQL 5.5last update
almost 2 years ago Waiting for branch to pass - 🇮🇳India mitthukumawat
I have checkout to
3172057-add-an-indicator
branch and found the class is added perfectly forsearch form
andsearch results listing
.
@Nelo_Drup adding a patch for you to try.
Adding screenshots of added class. - 🇮🇳India swatichouhan012
Hii @Grevil
Regarding MR14 We are using same class "search-404" for both Form and Search result. would be better to add different class names "search-404" and "search-404-results" ?
- 🇩🇪Germany Anybody Porta Westfalica
Better use
search-404
for both andsearch-404--results
for the results, I think? - 🇮🇳India mitthukumawat
I believe the "search-404" class for the form and results should be sufficient, considering that the "search-results" class is already the default for search pages.
This approach is generally applicable since search results are usually designed consistently across all search pages.
If developers want to make slight UI tweaks to the search 404 results, they can easily leverage the form class, reducing the necessity for extensive design adjustments. - Status changed to RTBC
over 1 year ago 8:09am 27 October 2023 - 🇮🇳India mitthukumawat
As the
search-404
class is present in 404 search results, we can move this to RTBC. - First commit to issue fork.
- Open on Drupal.org →Core: 9.5.x + Environment: PHP 7 & MySQL 5.5last update
over 1 year ago Waiting for branch to pass - 🇩🇪Germany Anybody Porta Westfalica
Has been merged already, see https://git.drupalcode.org/project/search404/-/merge_requests/14
- Status changed to Fixed
over 1 year ago 7:06am 31 October 2023 Automatically closed - issue fixed for 2 weeks with no activity.