Shopify logo change based on collections page

On my website I’m trying to make it so the logo changes based on the collections page the customer is on. I want it to alternate between 3 logos, PARTYSHIRTZZ, PARTYHATZZ, and PARTYFLAGZZ. I have tried multiple different variations of code but none seem to work. I have the below code written. If anyone has and suggestions or could help figure this out that would be great!

Its written in a separate liquid file which is then but in the header.liquid file like this:

This is the debut theme.

1 Like

Add this code

{% if collection %}
  {% case collection.handle %}
    {% when 'partyshirtzz' %}
      
        
      
    {% when 'partyhatzz' %}
      
        
      
    {% when 'partyflagzz' %}
      
        
      
    {% else %}
      
        
      
  {% endif %}

Thanks for the response! The code does not switch the logos.