Shopify themes, liquid, logos, and UX
I would like to be able to change it like so:
"type": "select",
"id": "banner_type",
"label": "Header Type",
"default": "image_all_pages",
"options": [
{ "value": "video_homepage", "label": "Video Header on Home Page Only" },
{ "value": "video_all_pages", "label": "Video Header On All Pages" },
{ "value": "image_all_pages", "label": "Default Header On All Pages" }
settings in theme.liquid
{% assign selected_header = settings.header_type %}
{% if selected_header == 'video_homepage' %}
{% if template.name == 'index' %}
{% section 'header' %} <!-- Video header on homepage -->
{% else %}
{% section 'header2' %} <!-- Default or alternative header on other pages -->
{% endif %}
{% elsif selected_header == 'video_all_pages' %}
{% section 'header' %} <!-- Video header on all pages -->
{% elsif selected_header == 'image_all_pages' %}
{% section 'header2' %} <!-- Default or alternative header on all pages -->
{% endif %}
added to settings_schema.json
"name": "Header Type",
"settings": [
{
"type": "select",
"id": "header_type",
"label": "Header Type",
"options": [
{ "value": "video_homepage", "label": "Video Header on Home Page Only" },
{ "value": "video_all_pages", "label": "Video Header On All Pages" },
{ "value": "image_all_pages", "label": "Default Header On All Pages" }
],
"default": "image_all_pages"
}
]
}]
I created a header2.liquid that is just a copy of the old header.liquid. The video header only displays across the site. I would also like to be able to customize header2.liquid from the schema in header.liquid if possible, and add a separate logo for header2.liquid
Thank you Julius. I thought that's what I was doing! Can you tell me where my code is wrong?
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024