Related to #3125328: Search form submit button should only be altered if it's in the header
When the search block form is moved outside of the Primary Menu region, it is not themed properly. It still inherit's its markup from the preprocess function, but it is not styled.
We could either
1) Style it
2) Have preprocess only modify it if it's in the primary menu region.

| Comment | File | Size | Author |
|---|---|---|---|
| #27 | interdiff-20-27.txt | 362 bytes | rahulrasgon |
| #27 | 3139046-27.patch | 1.27 KB | rahulrasgon |
| #10 | other_region_search.png | 348.2 KB | kiran.kadam911 |
| #10 | secondary_region_search_wide.png | 348.82 KB | kiran.kadam911 |
| #10 | primary_region_search_narrow.png | 321.21 KB | kiran.kadam911 |
Comments
Comment #2
komalk commentedComment #3
komalk commentedComment #4
komalk commentedThe button height to the input element is disturbed refer the after-patch screen shot .
tagging the related issue for the button height.
Comment #5
komalk commentedComment #6
matija5 commentedSearch form in menu has magnifier icon for submit button. Wouldn't be better to have it also in sidebar instead of text?
Icon is not showing because its styling is applied for .search-narrow__wrapper and .search-wide__wrapper classes. I think search should have some global styling and then its overrides in header search files.
Comment #7
matija5 commentedHi, after applying patch #3 the search button is displayed.
But I also did my take on this. I moved search icon to new css file for search and left specific styling for icon in header search files.
Comment #8
mherchelI would really like to address this within pre-process as opposed to CSS. The
/templates/form/input--submit--header-search.html.twigtemplate gets called on all search blocks. I'd like the template to only be called if the block is located in the primary nav or secondary nav regions.I believe we did something similar for the menu region at https://git.drupalcode.org/project/olivero/-/blob/8.x-1.x-dev/olivero.th...
Comment #9
kiran.kadam911taking this up as per the mentioned approach in last comment by @mherchel.
Comment #10
kiran.kadam911Sorry for the delay, Kindly review the attached patch.
Attaching screenshots of search blocks if it's in the menu region(primary and secondary) and if it's in another region.
Search block in the primary and secondary menu region:
Search block in another region:
Thanks!
Comment #11
Lal_Can we incorporate this under a condition... We don't want this run every time when form alter triggers
Comment #12
matija5 commentedhi, thanks for the patch. After applying patch#10 I don't have Search word in button. It is also applying template 'themes/contrib/olivero/templates/form/input--submit--header-search.html.twig' for search forms outside header.
Comment #13
kiran.kadam911Comment #14
kiran.kadam911Comment #15
sonvir249 commentedComment #16
matija5 commentedHi @sonvir249, can I give this a try?
Comment #17
Lal_Comment #18
hansa11 commentedComment #19
mherchel@hansa11 Any progress on this? I also see that you have assigned two other issues to yourself.
Comment #20
hansa11 commented@mherchel, yes I've been working on it but I was stuck at one point on this, now it's done and here is the patch.
Please review.
Thanks!
Comment #21
sd9121 commentedComment #22
sd9121 commented@hansa11,
I have reviewed your patch, it looks good to me.
Screenshot for reference:
Thanks!
Comment #23
sd9121 commentedComment #24
rahulrasgon commentedRTBC + 1 for Patch #20
Comment #25
mherchelCorrect me if I'm wrong, but we don't need to set this to FALSE. We can just remove this line, correct?
Comment #26
rahulrasgon commentedComment #27
rahulrasgon commentedPlease review the patch.
Thanks
Comment #28
sd9121 commentedComment #29
sd9121 commented@rahulrasgon,
Your patch looks good to me.
Thanks!
Comment #31
mherchelCommitted. Thanks!