Display Logo Header only on specific page

Hello,

I use the Brooklyn Theme. I would like to know how to indicate in html code an exception.

I use this code for the moment which works to hide my header menu and footer menu.

I would like to only display the logo/login/cart icon of the header not the menu.
How to create this exception in the code? Or a solution?

Thanks in advance !

1 Like

Hi,

Can you please share your website link?

@VDHSCA

{% if template.name == "index" %}
    do something or add your Code.
{% endif %}

Try out like this, Add your refrence page. which you want to add,

Thank you,

If you need any more help, let me know,

1 Like

Hello @VDHSCA ,

We would like to inform you that we will need Collaborator access and your Shopify store details to carefully look into this issue and provide you with a precise solution.

Normally it does not happen that the logo/login/cart is displayed on your menu on any webpage. However, if somehow it is visible on your menu page, you can try these methods to hide or remove the same.

  1. In this method, you can use a method where you can deploy a template-based condition to display the logo/login/cart on the specific pages menu and hide it on other pages

For e.g., Here is a code that can help you display your logo on specific pages with the use of a template.

You can similarly use this code for displaying login/cart etc.

{% if template contains ‘product’ %}

{% comment %}display logo for product page{% endcomment %}

{% elsif template contains ‘collection’ %}

{% comment %}display logo for ‘collection’ page{% endcomment %}

{% elsif template == ‘index’ %}

{% comment %}display logo for home page{% endcomment %}

…..

{% endif %}

  1. The next method is displaying the logo/login/cart on the specific page URL by putting a specific condition.

For eg - Here is the code where you can display your logo on specific pages, in this case - page 1, page 2, and page 3.

You can similarly paste the URL of the specific pages and the logo you want to display on those pages.

You can similarly use this code for displaying login/cart etc.

{% if handle == ‘page-1’ %}

{% comment %}display logo for page 1{% endcomment %}

{% elsif handle == ‘page-2’ %}

{% comment %}display logo for page 2{% endcomment %}

{% elsif handle == ‘page-3’ %}

{% comment %}display logo for page 3{% endcomment %}

…..

{% endif %}

Hope it was helpful. Please reach out to us if you need any further help. We recommend you to provide us with collaborator access so that we can help you better.

All the best,

Team CedCommerce

1 Like

Thanks a lot for your help ! I really do appreciate

1 Like