2021-11-29

Change a value to true on liquid Shopify overlay header

I'm trying to set the overlay header on some pages where the overlay header is not a standard setting on my Motion theme of my Shopify store.

This is the store link: https://hatproof.com/

I premise that I'm not very good on liquid code, and I'm asking here for help.

This are the original code lines:

assign template_name = template | replace: '.', ' ' | truncatewords: 2, '' | handle
assign sticky_header = false
  assign overlay_header = false

  if section.settings.header_sticky
    assign sticky_header = true
  endif

  if template_name == 'index' and section.settings.sticky_index
    assign overlay_header = true
  endif
  if template_name == 'collection' and collection.image and section.settings.sticky_collection
    assign overlay_header = true
  endif 

I've try to edit adding this on the bottom:

if template_name == 'page.chisiamo'
    assign overlay_header = true
  endif 

But the "overlay_header" value of the page https://hatproof.com/pages/nuovo-chi-siamo ('page.chisiamo' template name) hasn't changed to "true".

I've also try to edit the variable name in 'page', 'page chisiamo' but never worked.

This is how the value is used:

<div data-section-id="" data-section-type="header">
  <div id="HeaderWrapper" class="header-wrapper">

What can I do to change the "overlay_header" value to true of some specific pages?



from Recent Questions - Stack Overflow https://ift.tt/3xuiIVK
https://ift.tt/eA8V8J

No comments:

Post a Comment