Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi there,
I would like to include multiple links in the announcement bar: https://p4sp7y45jnbzfqov-58788085959.shopifypreview.com/
I want the words between each | to link to a different URL. Please help!
Thanks!
Hello, @julhobart
There is some coding needed to implement this functiionality.
Can you help with that?
can someone help me with this?
yes please user rich text schema code or share your header code so i will check and update
I tried to use html in the announcement bar text field but it didn't work, it just displayed the HTML as I typed it in. How do I share the header code? Here's a section from the header.liquid code that addresses the announcement bar. Please let me know if you'd like to see something else.
<div data-section-id="{{ section.id }}" data-section-type="header-section" data-header-section>
{% if section.settings.message %}
{% if section.settings.home_page_only == false or request.page_type == 'index' %}
<style>
.announcement-bar {
background-color: {{ section.settings.color_bg }};
}
.announcement-bar__link:hover {
{% assign brightness = section.settings.color_bg | color_brightness %}
{% if brightness <= 192 %}
{% assign lightenAmount = 255 | minus: brightness | divided_by: 255 | times: 16 %}
background-color: {{ section.settings.color_bg | color_lighten: lightenAmount }};
{% else %}
{% assign darkenAmount = 255 | divided_by: brightness | times: 8 %}
background-color: {{ section.settings.color_bg | color_darken: darkenAmount }};
{% endif %}
}
.announcement-bar__message {
color: {{ section.settings.color_text }};
}
</style>
<div class="announcement-bar" role="region" aria-label="{{ 'sections.header.announcement_bar_label' | t }}">
{%- unless section.settings.message_link == blank -%}
<a href="{{ section.settings.message_link }}" class="announcement-bar__link">
{%- endunless -%}
<p class="announcement-bar__message">{{ section.settings.message_text | escape }}</p>
{%- unless section.settings.message_link == blank -%}
</a>
{%- endunless -%}
</div>
{% endif %}
{% endif %}
thanks but schema code is missing
Hi! Sorry, I'm new to shopify. Where do I find the schema code? And is there a specific section you need to see?
yes please share full section code