Closed (fixed)
Project:
Olivero
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
23 Feb 2020 at 15:42 UTC
Updated:
24 Mar 2020 at 04:24 UTC
Jump to comment: Most recent, Most recent file
We need to insert two search blocks (one for narrow, one for wide) into the theme's header. The markup needs to be close to what's at the PoC (https://olivero-poc.netlify.com/).
The search blocks should not work if the search module is disabled, or if the user doesn't have the appropriate permission to perform a search.
One other random note: We may need to create a new region to provide separate place for things like page title, tabs. etc. if we go ahead with using the header region for the site branding block.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | 3115420-19.diff | 12.95 KB | hawkeye.twolf |
| #17 | 3115420-17.diff | 10.47 KB | hawkeye.twolf |
Comments
Comment #2
hawkeye.twolfHere's a suggestion of how we could lay out the regions (header, primary_menu, and secondary_menu) in page.html.twig. The crux is that the search block form needs different markup based on which region it gets placed into. I think we can use template suggestions to make that work. As a fallback, we could make a separate region just called "Search" and then print it twice, once in each place where it's needed with different wrappers.
Comment #3
hawkeye.twolfFYI, here's some sample code for adding region-specific block suggestions, if we decide to go that route (adapted from Twig Suggest):
Comment #4
hawkeye.twolfHere's a PoC for adding search markup according to theme settings, represented by the
oliverotemplate variable that doesn't currently exist, rather than the search block(s).Comment #5
hawkeye.twolfUpdating if statements to consider search setting.
Comment #6
hawkeye.twolfNext up: I'll tackle preprocessing the search form markup by the end of the week.
Comment #7
mrconnerton commentedLast patch had twig error. this one fixes that and uses the page.header_search variable from #3115429: Create theme settings for mobile menu
Comment #8
hawkeye.twolfThanks for adding that
header_searchtheme setting, @mrconnorton :) I've added a page preprocess that uses the setting here in this patch, so I'll submit a change to the other issue to take it out of the html preprocess.Comment #9
hawkeye.twolfRe-roll against latest HEAD.
@mherchel, I noticed that the
<div class="secondary-nav__wrapper">wrapper was removed frompage.html.twig. I've added it back here in this patch, but if the deletion was intentional, lemme know and I'll take it out.Comment #10
hawkeye.twolf(bad patch)
Comment #11
hawkeye.twolfHere's a patch to demonstrate a block-based approach as opposed to using theme-settings and loading the search form in hook_preprocess_page().
Comment #12
mherchelThanks! We'll look at this shortly.
Hey, I've been running into an issue with Firefox in Windows high contrast mode. The only solution I can find is to replace the
<input type="submit">with a<button>element (within the search forms).Can this be folded into this patch? The code would need to look something like this (this is currently in https://github.com/Lullabot/olivero-poc/pull/33)
Comment #13
hawkeye.twolfSure! I'll make new versions of each patch with this added in via
hook_form_alter().Comment #14
hawkeye.twolfComment #15
hawkeye.twolfI forgot to include a few files in the last patch. Here it is again, and with @mherchel's requested changes to the search form submit button markup.
This version of the patch is for the block-based (and IMO preferred) approach.
Comment #16
hawkeye.twolfHere's an updated version of the theme settings-based approach, with @mherchel's requested changes added in to change
inputs tobuttons.Comment #17
hawkeye.twolfUpdating patch from #16 as I forgot to include a file.
Comment #18
hawkeye.twolfUpdated block-based approach patch from #15 (improved twig file comment).
Comment #19
hawkeye.twolfHides block labels.
Comment #20
proeungComment #21
proeung@hawkeye.twolf Thanks for submitting this patch! I just tested your patch and made some minor adjustments, but the two search blocks (narrow and wide) are looking great! https://git.drupalcode.org/project/olivero/-/commit/10e9c47595f07aacc97e...
See the latest tugboat preview here - https://8-x-1-x-dev-2t4d1epwkj8tgwxduizmixhzevqwzi8w.tugboat.qa/
Also, we'll need to render the search form placeholder text and move the search icon to be inline SVG, but we'll take of that in another ticket. Thanks for all of your help in this again!