Hi there,
Our business www.komerco.com.au would like to have a sticky search bar on top of the hero image on the website. We are currently using the debut theme. Any ideas on how best to do this?
Many Thanks
Hi there,
Our business www.komerco.com.au would like to have a sticky search bar on top of the hero image on the website. We are currently using the debut theme. Any ideas on how best to do this?
Many Thanks
sorry for issue
if possible to give me rough idea how do you have like this so i will guide you.
Thanks for the details i have this sorry is not possible simple CSS code
It can be done by doing some code customization. Please take the help of a developer and hire Shopify Expert or me
@Andrew-Alcott You can do this in two simple steps. Try it on duplicate theme first, instead of the live theme
Open sections/hero.liquid ( Image with text overlay section) , locate
Copy the search-form code from templates/search.liquid (line 21-53) and paste it before the closing tag of
If you need to regulate the width of search-form you can use the following CSS selector
.hero__inner > form.search-form { max-width: xx}
Finally the updated code inside
should look like below. Let me know how it goes. (“theme_version”: “17.12.1”)
{%- if section.settings.title != blank -%}
## {{ section.settings.title | escape }}
{%- endif -%}
{%- if section.settings.text != blank -%}
{{ section.settings.text }}
{%- endif -%}
{%- if section.settings.button_label != blank and section.settings.button_link != blank -%}
{%- capture ariaLabel -%}
{{- section.settings.button_label -}}
{%- if section.settings.button_link.type == 'frontpage_link' -%}
: {{ 'homepage.general.title' | t -}}
{%- elsif section.settings.button_link.type == 'catalog_link' -%}
: {{ 'collections.catalog.title' | t -}}
{%- elsif section.settings.button_link.object.title -%}
: {{ section.settings.button_link.object.title -}}
{%- endif -%}
{%- endcapture -%}
{{- section.settings.button_label | escape -}}
{%- endif -%}
Lixon_louis,
Amazing help so far, what you’ve suggested has placed the search bar in the hero image - a great result so thank you. A couple of minor issues as a result:
Firstly, there doesn’t seem to be any padding between the subtitle text and the search bar and I’m not sure where to add the bottom-padding code here. Any ideas? It would be preferable to have the container centred against the hero image.
Secondly, I’m getting an error message in my portal saying:
HTML error found
Broken HTML has been detected in your theme’s code.
Here’s the C&P:
Lixon,
Thanks for spotting that extra div. That solved the issue.
In terms of the code, I’m still not sure where I place:
.hero__inner > form.search-form { margin-top: 40px}
Which line would you paste the code on your last screenshot?
Hopefully that should sort everything - thank you it is greatly, greatly appreciated.
Paste it at the very bottom of Assets/theme.css. If you are using older version of Debut, look for theme.scss.liquid inside Assets/
Remove the ‘>’
.hero__inner form.search-form { margin-top: 40px}
Should have worked that out myself rather than putting it into the hero snippet.
Thank you kindly for your help, very good of you.