Different Header On Different Pages Conditional DAWN THEME

Different Header On Different Pages Conditional DAWN THEME

iemsource
Visitor
2 0 0

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

Reply 1 (1)
iemsource
Visitor
2 0 0

Thank you Julius. I thought that's what I was doing! Can you tell me where my code is wrong?