Re: Remove 'No IMG' stock images from Header Menu

Solved

Remove 'No IMG' stock images from Header Menu

Thomas558
Excursionist
12 1 0

Hello

 

I have images connected to my Header Menu with the use of Metafields.

However, some menu items in my header are Direct Links and do not have an image attatched to it.

This automatically makes these menu items show a stock image that says ( No IMG ).

 

So my problem: I need to Remove these images without removing those i connected to collections and pages with metafields & custom code.

 

Additionally: If you know a quick and easy way, without apps, to also add images to these URL / Direct Links in my Header Menu Navigation-.. that would be even better.

 

Thank you in advance!

Accepted Solution (1)
Thomas558
Excursionist
12 1 0

This is an accepted solution.

This was solved outside of this post, Thanks for the help!

View solution in original post

Replies 5 (5)

Thomas558
Excursionist
12 1 0

TrT.png

 

Here is what it looks like

made4Uo
Shopify Partner
3860 717 1204

Hi @Thomas558 

 

You have to add a control flow. I assume you are using a custom code. You can add an if else statement depending on what metafield type you are using,  You can use the code below as reference.

 

{% if metafield.image != blank $}
Your metafield here
{% endif $}

 

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free
Thomas558
Excursionist
12 1 0

Thank you for your reply, unfortunately i cant figure out Where and What to code to fix this.

 

I followed this tutorial to add my Images to the header: https://www.youtube.com/watch?v=wUWo39swCC4

 

I THINK the place where i need to add this 'control flow' you're talking about is in Header-Menu-Liquid, where i added the following custom code:

 

{% if section.settings.menu_type_desktop == 'mega' and section.settings.mega_menu_images_toggle != 'none' %}
{% render 'megamenu-image-custom',
link:link,
menu_images_toggle: section.settings.mega_menu_images_toggle,
menu_titles_toggle: section.settings.mega_menu_images_title,
megamenu_backdrop_toggle: section.settings.megamenu_backdrop_toggle
%}
{% else %}

 

 

 

made4Uo
Shopify Partner
3860 717 1204

You need to find your metafield code and check if an image us not blank. It might be the file megamenu-image-custom.liquid under Snippet folder

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free
Thomas558
Excursionist
12 1 0

This is an accepted solution.

This was solved outside of this post, Thanks for the help!