#error!

Hello,

I am in the process of carrying over custom coding to the Alchemy theme as it was just updated to Online Store 2.0.

The code I used before that worked fine was:


          
          {%- if section.settings.logo != blank -%}
          
            
            {%- if section.settings.alt_logo -%}
            
            {%- endif -%}
          

I went ahead and made the same adjustments to my new 2.0 theme below, but the SVG logo will not show and now I have an error:


          
          {%- if section.settings.logo != blank -%}
            
              
              {%- if section.settings.alt_logo -%}
              
              {%- endif -%}
            

The error in Google Console is

Would anyone know what that liquid error is or how to fix it? I’ve searched everywhere with no luck.

If it helps, below is the entire header.liquid code:

{%- capture logo_size -%}{{ section.settings.logo_width | default: 250 | times: 2 }}x{%- endcapture -%}

{%- liquid
  assign has_curr_dd = false
  assign has_lang_dd = false

  if section.settings.show_currency_selector and shop.enabled_currencies.size > 1
    assign has_curr_dd = true
  endif

  if section.settings.show_locale_selector and shop.published_locales.size > 1
    assign has_lang_dd = true
  endif

  if has_curr_dd and has_lang_dd
    assign min_hdr_items_width = 320
  elsif has_curr_dd or has_lang_dd
    assign min_hdr_items_width = 250
  else
    assign min_hdr_items_width = 132
  endif

  if section.settings.logo_width > min_hdr_items_width
    assign hdr_items_width = section.settings.logo_width
  else
    assign hdr_items_width = min_hdr_items_width
  endif

  assign logo_width = section.settings.logo_width | plus: 0
  assign logo_height = 44

  if section.settings.logo != blank
    assign actual_logo_height = logo_width | divided_by: section.settings.logo.aspect_ratio

    if actual_logo_height > 44 and actual_logo_height <= 150
      assign logo_height = actual_logo_height | round
    elsif actual_logo_height > 150
      assign logo_height = 150
    endif
  endif

  assign header_height = logo_height | plus: 52
-%}

{% style %}
  {%- if section.settings.enable_sticky -%}
    .js .section-header {
      position: -webkit-sticky;
      position: sticky;
    }
    {%- if section.settings.enable_logo_shrink -%}
      {%- if logo_height == 150 -%}
        .scrolled-down .pageheader .logo img { max-height: {{ logo_height | times: 0.75 | round }}px; }
        @media (max-width: 767px) {
          .scrolled-down .pageheader .logo img { max-height: {{ logo_height | times: 0.65 | round }}px; }
        }
      {%- else -%}
        .scrolled-down .pageheader .logo__image { max-width: {{ section.settings.logo_width | times: 0.75 | round }}px; }
        @media (max-width: 767px) {
          .scrolled-down .pageheader .logo__image { max-width: {{ section.settings.logo_width | times: 0.65 | round }}px; }
        }
      {%- endif -%}
    {%- endif -%}
  {%- endif -%}

  {%- if section.settings.enable_header_overlap -%}
    .js .section-header { height: {{ header_height }}px; }
    .js .scrolled-down .section-header { height: {{ header_height | minus: 13 }}px; }
    .js .banner-candidate:first-child,
    .js .template-customer-area .banner { margin-top: -{{ header_height }}px; }
    .js .banner-candidate:first-child .spaced-section,
    .js .banner-candidate:first-child .spaced-section-sm,
    .js .banner-candidate:first-child .banner-image .overlay { padding-top: {{ header_height }}px; }
    @media (min-width: 768px) {
      .js .banner-candidate:first-child .banner-image.fixed-height .innest {
        margin-bottom: {{ settings.content_header_overlap }}px;
      }
    }
    {%- if logo_height > 44 -%}
      {%- comment -%}
      .shopify-section:not(.banner-candidate):first-child { margin-top: {{ header_height }}px; }
      {%- endcomment -%}
      {%- if settings.show_breadcrumbs -%}
        .header-overlapping .banner-candidate:first-child .banner:not(.banner--no-breadcrumb),
        .header-overlapping.template-customer-area .banner {
          padding-top: {{ header_height | plus: 25 }}px;
        }
        .header-overlapping .banner-candidate:first-child .breadcrumbs {
          margin-top: {{ logo_height | round | minus: 44 }}px
        }
        @media (min-width: 768px) {
          .header-overlapping .banner-candidate:first-child .banner:not(.banner--no-breadcrumb),
          .header-overlapping.template-customer-area .banner {
            padding-top: {{ header_height | plus: 55 }}px;
          }
        }
      {%- else -%}
        .header-overlapping .banner-candidate:first-child .banner:not(.banner--no-breadcrumb),
        .header-overlapping.template-customer-area .banner {
          padding-top: {{ header_height | plus: 25 }}px;
        }
      {%- endif -%}
    {%- endif -%}
  {%- endif -%}
  .no-banner .pageheader__layout::before {
    border-bottom: 1px solid {{ settings.col_text | color_mix: settings.col_page_bg, 20 }};
  }
  .no-banner .pageheader__contents .tier-appeared, .pageheader__contents .nav-rows::before {
    border-top: none !important;
  }
  .pageheader__contents--inline--visible.pageheader__contents--inline--left-logo .header-items,
  .pageheader__contents--inline--visible.pageheader__contents--inline--left-logo .logo {
    flex-basis: {{ hdr_items_width }}px !important;
  }
  .pageheader__contents--inline--left-logo:not(.pageheader__contents--inline--visible) .site-control__inline-links .nav-row {
    min-width: calc(100vw - {{ hdr_items_width | times: 2 | plus: 100 }}px);
  }
  .pageheader .logo__image { max-width: {{ section.settings.logo_width }}px; }
{% endstyle %}

{%- if template == 'password' or template == 'gift_card' -%}
  {% comment %} Password/gift card template logo {% endcomment %}
  
{%- else -%}

{%- if section.settings.logo != blank and logo_height > 100 and section.settings.enable_sticky == false -%}
  {%- assign header_alignment_class = ' pageheader__contents--top' -%}
{%- endif -%}

  

    
  

  
    

    

      ## {{ 'layout.search.title' | t }}
      
      
        

          {%- for i in (1..5) -%}
            

              

                

                
                  {%- if settings.live_search_show_vendor -%}
                    

                  {%- endif -%}
                  

                  

                

              

            

          {%- endfor -%}
        

        

      

      {%- if section.settings.search_menu_linklist != blank and linklists[section.settings.search_menu_linklist].links.size > 0 -%}
        
          {%- if section.settings.search_menu_title != blank -%}
            ### {{ section.settings.search_menu_title }}
          {%- endif -%}

          
            {%- for link in linklists[section.settings.search_menu_linklist].links -%}
              - {{ link.title | strip }}
            {%- endfor -%}
          

        

      {% endif %}
    

  

{%- endif -%}

{% schema %}
  {
    "name": "Header",
    "class": "section-header",
    "settings": [
      {
        "type": "image_picker",
        "id": "logo",
        "label": "Main logo",
        "info": "300 x 100px recommended"
      },
			{
        "type": "image_picker",
        "id": "alt_logo",
        "label": "Contrast logo",
        "info": "Optional logo used when over the header slideshow and images"
      },
      {
        "type": "range",
        "id": "logo_width",
        "min": 30,
        "max": 250,
        "step": 5,
        "label": "Maximum logo width",
        "info": "Logo height is restricted to 150px",
        "default": 100,
        "unit": "px"
      },
      {
        "type": "checkbox",
        "id": "enable_sticky",
        "label": "Enable sticky header",
        "default": true
      },
      {
        "type": "checkbox",
        "id": "enable_header_overlap",
        "label": "Show header on top of banner images",
        "default": true
      },
      {
        "type": "checkbox",
        "id": "enable_logo_shrink",
        "label": "Shrink logo on scroll down",
        "default": true
      },
      {
        "type": "header",
        "content": "Navigation"
      },
      {
				"type": "link_list",
				"id": "menu_linklist",
				"label": "Menu",
				"default": "main-menu"
      },
      {
				"type": "richtext",
				"id": "menu_under_text",
				"label": "Side menu footer text"
      },
      {
        "type": "checkbox",
        "id": "enable_inline_links",
        "label": "Show inline menu",
        "info": "Links will only be shown on larger screens and when they fit, otherwise the side menu link will be shown.",
        "default": false
      },
      {
        "type": "checkbox",
        "id": "menu_align_logo_left",
        "label": "Keep the logo on the left",
        "info": "Only applies to the inline menu",
        "default": false
      },
      {
        "type": "header",
        "content": "Search"
      },
      {
				"type": "text",
				"id": "search_menu_title",
				"label": "Quick links heading"
      },
      {
				"type": "link_list",
				"id": "search_menu_linklist",
				"label": "Quick links menu"
      },
      {
        "type": "header",
        "content": "Contact information"
      },
      {
        "type": "paragraph",
        "content": "Shown in the side menu"
      },
      {
        "type": "checkbox",
        "id": "show_social_links",
        "label": "Show social icons",
        "info": "These can be added in Theme Settings > Social media",
        "default": false
      },
      {
				"type": "text",
				"id": "contact_info_phone",
				"label": "Phone number"
      },
      {
				"type": "text",
				"id": "contact_info_email",
				"label": "Email address",
        "info": "This should be just an email address, no additional words."
      },
      {
        "type": "checkbox",
        "id": "contact_info_in_mega",
        "label": "Show contact information in mega menus",
        "default": true
      },
      {
        "type": "header",
        "content": "Menu promotion tint"
      },
      {
        "type": "color",
        "id": "text_color",
        "label": "Text color",
        "default": "#ffffff"
      },
      {
        "type": "color",
        "id": "tint_color",
        "label": "Tint",
        "default": "#000000"
      },
      {
        "type": "range",
        "id": "tint_opacity",
        "min": 0,
        "max": 100,
        "step": 1,
        "unit": "%",
        "label": "Tint strength",
        "default": 25
      },
      {
        "type": "header",
        "content": "Language Selector",
        "info": "To add a language, go to your [language settings.](/admin/settings/languages)"
      },
      {
        "type": "checkbox",
        "id": "show_locale_selector",
        "label": "Show language selector",
        "default": false
      },
      {
        "type": "header",
        "content": "Currency Selector",
        "info": "To add a currency, go to your [payment settings.](/admin/settings/payments)"
      },
      {
        "type": "checkbox",
        "id": "show_currency_selector",
        "label": "Show currency selector",
        "default": false
      }
		],
    "blocks": [
      {
        "type": "image",
        "name": "Menu promotion",
        "settings": [
          {
            "type": "paragraph",
            "content": "Promotions will only be shown when they fit on the screen. If you can't see all of your promotions, try making your browser window larger. [Learn more](https://support.cleancanvas.co.uk/alchemy-theme-support/header-footer-alchemy/#inner-anchor-1)"
          },
          {
            "type": "header",
            "content": "Where to show"
          },
          {
            "type": "text",
            "id": "menu_item",
            "label": "Menu item",
            "info": "Enter a dropdown menu item title to display the menu promotion on, e.g. 'Shop'. If you leave this empty, the menu promotion will show on the first level of the side menu popup."
          },
          {
            "type": "header",
            "content": "Details"
          },
          {
            "type": "image_picker",
            "id": "image",
            "label": "Image"
          },
          {
            "type": "textarea",
            "id": "title",
            "label": "Heading"
          },
          {
            "type": "text",
            "id": "subheading",
            "label": "Subheading"
          },
          {
            "type": "text",
            "id": "button_label",
            "label": "Link text"
          },
          {
            "type": "url",
            "id": "cta_link",
            "label": "Link URL"
          }
        ]
      }
    ]
  }
{% endschema %}

Thank you.

Hi, in the new code you added


but asset_url doesn’t accept parameters, so you should remove logo_size, as in this code


Hello, I Can Show You How To Add SVG Logo in Dawn Theme Shopify By watching this tutorial:

https://youtu.be/j7eJ-HiPt6c