A space to discuss online store customization, theme development, and Liquid templating.
Hi Ti7,
The search icon in Dawn is a SVG symbol element that's hardcoded into the theme so changing it is not as simple as adding a new image file - you would need to either use a different SVG and manually add that code to the theme, or implement a different technique for displaying an icon (like using an SVG file that's stored in the /assets directory).
You can see where the icon is being hardcorded here on the most recent version of Dawn - you could replace this with code for an SVG, or remove the native approach and upload an SVG to the /assets directory and use the asset_img_url filter to render it on the header.
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hi when I do this and replace with the svg code (I will put below) the search icon just disappears however when i hover over where it was i can still click on it and when i do click on it it allows me to search.
The SVG code you're sharing here is a slightly different implementation as it's not using the <symbol> tag, so swapping our the native version for this likely would cause an error. It's also a much more complex looking SVG compared to the very basic one that Dawn uses, so I'd recommend including it as a file rather than coded into the theme file. There's info in this forum post on how to add and display an SVG to a theme, but you'll need to modify it a bit so that the icon shows up exactly where you want.
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Ive tried to modify it but still getting nowhere could you help with what parts i need to modify and what to do