banner/slim-banner-url.html

---
banner_default_classes: "px-5 py-5 mb-8"
banner_background_color: "bg-ocean-40"
banner_text_color: "ocean"
---
{{#
/**
 * @name banner/slim-banner-url
 * @description A partial for a ribbon-thin banner with a simple text link
 * @property {string} [banner_default_classes="px-5 py-5 mb-8 m--mb-11"]
 * @property {string} [banner_custom_classes]
 * @property {string} [banner_background_color]
 * @property {string} [banner_text_color]
 * @property {string} [generic_study_hall]
 * @property {string} [targeted_study_hall]
 */
 #}}

<section class="{{ banner_custom_classes or banner_default_classes }} {{ banner_background_color }} ta-center w-100 {{ if !show_banner }}none{{ /if }}">

  {{# if there IS a feature link set, display the custom feature content #}}
  {{ if link_url }}
  <a href="{{ link_url }}" class="{{ banner_text_color }} my-0 fw-500 fs-4 lh-4 link hover-link-border-arrow b-{{ banner_text_color }} hover-{{ banner_text_color }}-120">
    {{ link_text }} <i class="rarr bc-{{ banner_text_color }}"></i>
  </a>
  {{ /if }}

  {{# if there IS NOT a feature link set, look for an upcoming study hall event #}}
  {{ if !link_url }}
    {{
      collection:events
      as="posts"
      end_date:is_after="today"
      event_type:is="study-hall"
      location:is="{ geo:location }"
      sort="start_date"
      limit="1"
    }}

      {{# if there IS NOT an upcoming study hall in the city, link to the general Study Hall events page  #}}
      {{ if no_results }}
          <a href="/events" class="{{ banner_text_color }} my-0 fw-500 fs-4 lh-4 link hover-link-border-arrow b-{{ banner_text_color }} hover-{{ banner_text_color }}-120">
            {{ generic_study_hall }} <i class="rarr bc-{{ banner_text_color }}"></i>
          </a>
      {{ /if }}

      {{# if there IS an upcoming study hall in the city, link to that Study Hall  #}}
      {{ if !no_results }}
        {{ posts }}
        <a href="{{ url_href }}" class="{{ banner_text_color }} my-0 fw-500 fs-4 lh-4 link hover-link-border-arrow b-{{ banner_text_color }} hover-{{ banner_text_color }}-120">
          {{ targeted_study_hall }} <i class="rarr bc-{{ banner_text_color }}"></i>
        </a>
        {{ /posts }}
      {{ /if }}

    {{ /collection:events }}
  {{ /if }}

</section>