Announcement bar disappeared and error on site

Solved
Highlighted
New Member
5 0 0

Hi there,

I am new to this and my announcement bar disappeared and the message below shows. Can someone please help? I have the Impulse theme. 

Liquid error (sections/header.liquid line 195): Could not find asset snippets/announcement-bar.liquid

Thank you so much in advance!

0 Likes
Highlighted
Shopify Partner
1593 347 465

Hey @waywardco,

Please share your website URL and code of snippets/announcement-bar.liquid file.

So I can check and provide a solution here.

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted
New Member
5 0 0

Hi there,

Thanks so much for the quick reply!

Please see info below and let me know if you need anything else. 

https://waywardco.com

This is the code for the announcement bar:

{%- assign show_announcement = false -%}
{%- assign announcement_block_count = 0 -%}
{% for block in section.blocks %}
{% if block.type == 'announcement' %}
{%- assign show_announcement = true -%}
{%- assign announcement_block_count = announcement_block_count | plus: 1 -%}
{% endif %}
{% endfor %}

{% if show_announcement %}
<div class="announcement-bar">
<div class="page-width">
<div
id="AnnouncementSlider"
class="announcement-slider{% if section.settings.announcement_compact %} announcement-slider--compact{% endif %}"
data-compact-style="{{ section.settings.announcement_compact }}"
data-block-count="{{ announcement_block_count }}">
{%- assign slide_index = 0 -%}
{% for block in section.blocks %}
{% if block.type == 'announcement' %}
<div
id="AnnouncementSlide-{{ block.id }}"
class="announcement-slider__slide"
data-index="{{ slide_index }}"
{{ block.shopify_attributes }}>
{% if block.settings.link != blank %}
<a class="announcement-link" href="{{ block.settings.link }}">
{% endif %}
{% if block.settings.text != blank %}
<span class="announcement-text">{{ block.settings.text }}</span>
{% endif %}
{% if block.settings.link_text != blank %}
<span class="announcement-link-text">{{ block.settings.link_text }}</span>
{% endif %}
{% if block.settings.link != blank %}
</a>
{% endif %}
</div>
{%- assign slide_index = slide_index | plus: 1 -%}
{% endif %}
{% endfor %}
</div>
</div>
</div>

{% endif %}

0 Likes
Highlighted
Shopify Partner
1593 347 465

Hey @waywardco,

Thanks for the code. I can see your shop is password protected.

Please provide a code of header. liquid also. So both I can check.

 

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted
Shopify Partner
1593 347 465

Hey @waywardco,

Also, let me know which theme you are using?

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted

This is an accepted solution.

Hey Waywardco,

Have a look at your SECTIONS  >> header.liquid

its asking for SNIPPETS announcement-bar.liquid but its NOT THERE - line 195  !!??

check that you have a SNIPPET called announcement-bar.liquid

if not go and get another copy of the theme and ad it back in. ( add theme from shopify on the THEMES page )

What did you do to delete it ?? :)

 

Dan 'the web man' | Shopify Partner
If this was helpful then please Like and let me know!
If this answered your question click Accept as Solution
Want to modify or make custom changes on your store? I'm available for hire!
Secure Email: See https://dans-development-store.myshopify.com
0 Likes
Highlighted
New Member
5 0 0

Hi there,

I am using Impulse theme. Please see code below for header.liquid. Thanks again for the help!

{%- assign main_menu = linklists[section.settings.main_menu_link_list] -%}
{%- assign toolbar_menu = linklists[section.settings.toolbar_menu] -%}

{%- assign logo_alignment = 'left' -%}
{% if section.settings.main_menu_alignment == 'center-left' or section.settings.main_menu_alignment == 'center-split' or section.settings.main_menu_alignment == 'center' or section.settings.main_menu_alignment == 'center-drawer' %}
{%- assign logo_alignment = 'center' -%}
{% endif %}

{%- assign dropdown_alignment = 'left' -%}
{% if section.settings.main_menu_alignment == 'left-center' or section.settings.main_menu_alignment == 'center-split' or section.settings.main_menu_alignment == 'center' %}
{%- assign dropdown_alignment = 'center' -%}
{% endif %}

{% include 'drawer-menu' %}
{% include 'cart-drawer' %}

{%- assign template_name = template | replace: '.', ' ' | truncatewords: 2, '' | handle -%}

{%- assign sticky_header = false -%}
{% if section.settings.header_style == 'sticky' %}
{%- assign sticky_header = true -%}
{% endif %}
{%- assign overlay_header = false -%}
{%- assign has_logo = false -%}
{% 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 %}

{% style %}
.site-nav__link,
.site-nav__dropdown-link:not(.site-nav__dropdown-link--top-level) {
font-size: {{ settings.type_navigation_size }}px;
}
{% if settings.type_navigation_capitalize %}
.site-nav__link, .mobile-nav__link--top-level {
text-transform: uppercase;
letter-spacing: 0.2em;
}
.mobile-nav__link--top-level {
font-size: 1.1em;
}
{% endif %}

{% if mainmenu.length > 6 %}
.site-nav__link {
padding-left: 10px;
padding-right: 10px;
}
{% endif %}

{% unless section.settings.mega_menu_images %}
.megamenu__colection-image {
display: none;
}
{% endunless %}
{% endstyle %}

<div data-section-id="{{ section.id }}" data-section-type="header-section">
{% if overlay_header or section.settings.announcement_above_header %}
{% include 'announcement-bar' %}
{% endif %}

{% unless overlay_header %}
{% if settings.enable_currencies or section.settings.toolbar_social or section.settings.toolbar_menu != blank %}
{% include 'toolbar',
overlay_header: overlay_header,
show_currency_flags: section.settings.show_currency_flags
%}
{% endif %}
{% endunless %}

<div class="header-sticky-wrapper">
<div class="header-wrapper{% if overlay_header %} header-wrapper--sticky is-light{% endif %}">

{% if overlay_header %}
{% if settings.enable_currencies or section.settings.toolbar_social or section.settings.toolbar_menu != blank %}
{% include 'toolbar',
overlay_header: overlay_header,
show_currency_flags: section.settings.show_currency_flags
%}
{% endif %}
{% endif %}
<header
class="site-header{% if settings.type_navigation_style == 'heading' %} site-header--heading-style{% endif %}"
data-sticky="{{ sticky_header }}">
<div class="page-width">
<div
class="header-layout header-layout--{{ section.settings.main_menu_alignment }}"
data-logo-align="{{ logo_alignment }}">

{% if logo_alignment == 'left' %}
<div class="header-item header-item--logo">
{% include 'header-logo-block' %}
</div>
{% endif %}

{% if logo_alignment == 'left' and section.settings.main_menu_alignment != 'left-drawer' %}
<div class="header-item header-item--navigation{% if section.settings.main_menu_alignment == 'left-center' %} text-center{% endif %}">
{% include 'header-desktop-nav' %}
</div>
{% endif %}

{% if logo_alignment == 'center' %}
<div class="header-item header-item--left header-item--navigation">
{% if section.settings.main_menu_alignment == 'center' or section.settings.main_menu_alignment == 'center-split' %}
{% if settings.search_enable %}
<div class="site-nav small--hide">
<a href="{{ routes.search_url }}" class="site-nav__link site-nav__link--icon js-search-header js-no-transition">
<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-search" viewBox="0 0 64 64"><path d="M47.16 28.58A18.58 18.58 0 1 1 28.58 10a18.58 18.58 0 0 1 18.58 18.58zM54 54L41.94 42"/></svg>
<span class="icon__fallback-text">{{ 'general.search.title' | t }}</span>
</a>
</div>
{% endif %}
{% endif %}

{% if section.settings.main_menu_alignment == 'center-left' %}
{% include 'header-desktop-nav' %}
{% endif %}

<div class="site-nav{% unless section.settings.main_menu_alignment == 'center-drawer' %} medium-up--hide{% endunless %}">
<button
type="button"
class="site-nav__link site-nav__link--icon js-drawer-open-nav"
aria-controls="NavDrawer">
<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-hamburger" viewBox="0 0 64 64"><path d="M7 15h51M7 32h43M7 49h51"/></svg>
<span class="icon__fallback-text">{{ 'general.drawers.navigation' | t }}</span>
</button>
</div>
</div>

{% if section.settings.main_menu_alignment == 'center-split' %}
{% include 'header-split-nav' %}
{% endif %}

{% if section.settings.main_menu_alignment != 'center-split' %}
<div class="header-item header-item--logo">
{% include 'header-logo-block' %}
</div>
{% endif %}
{% endif %}

<div class="header-item header-item--icons">
{% include 'header-icons' %}
</div>
</div>

{% if section.settings.main_menu_alignment == 'center' %}
<div class="text-center">
{% include 'header-desktop-nav' %}
</div>
{% endif %}
</div>
<div class="site-header__search-container">
<div class="site-header__search">
<div class="page-width">
<form action="{{ routes.search_url }}" method="get" role="search"
id="HeaderSearchForm"
class="site-header__search-form">
<input type="hidden" name="type" value="{{ settings.search_type }}">
<button type="submit" class="text-link site-header__search-btn site-header__search-btn--submit">
<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-search" viewBox="0 0 64 64"><path d="M47.16 28.58A18.58 18.58 0 1 1 28.58 10a18.58 18.58 0 0 1 18.58 18.58zM54 54L41.94 42"/></svg>
<span class="icon__fallback-text">{{ 'general.search.submit' | t }}</span>
</button>
<input type="search" name="q" value="{{ search.terms | escape | replace: '*', '' }}" placeholder="{{ 'general.search.placeholder' | t }}" class="site-header__search-input" aria-label="{{ 'general.search.placeholder' | t }}">
</form>
<button type="button" class="js-search-header-close text-link site-header__search-btn">
<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-close" viewBox="0 0 64 64"><path d="M19 17.61l27.12 27.13m0-27.12L19 44.74"/></svg>
<span class="icon__fallback-text">{{ 'general.accessibility.close_modal' | t | json }}</span>
</button>
</div>
</div>
{%- if settings.predictive_search_enabled -%}
<div class="predictive-results hide">
<div class="page-width">
<div id="PredictiveResults"></div>
<div class="text-center predictive-results__footer">
<button type="button" class="btn btn--small" data-predictive-search-button>
<small>
{{ 'general.search.view_more' | t }}
</small>
</button>
</div>
</div>
</div>
{%- endif -%}
</div>
</header>
</div>
</div>

{% unless overlay_header or section.settings.announcement_above_header %}
{% include 'announcement-bar' %}
{% endunless %}
</div>

{% schema %}
{
"name": "Header",
"settings": [
{
"type": "link_list",
"id": "main_menu_link_list",
"label": "Navigation",
"default": "main-menu"
},
{
"type": "checkbox",
"id": "mega_menu_images",
"label": "Show mega menu images",
"default": true,
"info": "[How to create a mega menu](https://archetypethemes.co/blogs/impulse/how-do-i-create-a-mega-menu)"
},
{
"type": "select",
"id": "main_menu_alignment",
"label": "Header layout",
"default": "left",
"options": [
{
"value": "left",
"label": "Logo left, menu left"
},
{
"value": "left-center",
"label": "Logo left, menu center"
},
{
"value": "left-drawer",
"label": "Logo left, menu drawer"
},
{
"value": "center-left",
"label": "Logo center, menu left"
},
{
"value": "center-split",
"label": "Logo center, menu split"
},
{
"value": "center",
"label": "Logo center, menu below"
},
{
"value": "center-drawer",
"label": "Logo center, menu drawer"
}
]
},
{
"type": "select",
"id": "header_style",
"label": "Header style",
"default": "normal",
"options": [
{
"value": "normal",
"label": "Normal"
},
{
"value": "sticky",
"label": "Sticky"
}
]
},
{
"type": "checkbox",
"id": "sticky_index",
"label": "Overlay header over home page",
"default": false
},
{
"type": "checkbox",
"id": "sticky_collection",
"label": "Overlay header over collection",
"info": "(if collection image is enabled)",
"default": false
},
{
"type": "header",
"content": "Announcement bar"
},
{
"type": "checkbox",
"id": "announcement_compact",
"label": "Use compact style"
},
{
"type": "checkbox",
"id": "announcement_above_header",
"label": "Always show above header"
},
{
"type": "header",
"content": "Toolbar"
},
{
"type": "link_list",
"id": "toolbar_menu",
"label": "Navigation",
"info": "This menu won't show dropdown items"
},
{
"type": "checkbox",
"id": "toolbar_social",
"label": "Show social icons"
},
{
"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": true
},
{
"type": "header",
"content": "Currency selector",
"info": "To add a currency, go to your [currency settings.](/admin/settings/payments)"
},
{
"type": "checkbox",
"id": "show_currency_selector",
"label": "Show currency selector",
"default": true
},
{
"type": "checkbox",
"id": "show_currency_flags",
"label": "Show currency flags",
"default": true
}
],
"blocks": [
{
"type": "logo",
"name": "Logo",
"limit": 1,
"settings": [
{
"type": "image_picker",
"id": "logo",
"label": "Logo"
},
{
"type": "image_picker",
"id": "logo-inverted",
"label": "White logo",
"info": "Used when on top of an image"
},
{
"type": "range",
"id": "desktop_logo_width",
"label": "Desktop logo width",
"default": 200,
"min": 100,
"max": 400,
"step": 10,
"unit": "px"
},
{
"type": "range",
"id": "mobile_logo_width",
"label": "Mobile logo width",
"default": 140,
"min": 60,
"max": 200,
"step": 10,
"unit": "px",
"info": "Set as a max-width, may appear smaller"
}
]
},
{
"type": "announcement",
"name": "Announcement",
"limit": 3,
"settings": [
{
"type": "text",
"id": "text",
"label": "Heading",
"default": "Hassle-free returns"
},
{
"type": "text",
"id": "link_text",
"label": "Text",
"default": "30-day postage paid returns"
},
{
"type": "url",
"id": "link",
"label": "Link"
}
]
}
],
"default": {
"settings": {}
}
}
{% endschema %}

 

0 Likes
Highlighted
New Member
5 0 0

Thank you, this worked! TBH not sure how I deleted it! I was trying to figure out a way to make the announcement bar text larger and with me being new to this, I am most positive it was a user error! 

Thank you, thank you!!!

0 Likes