Skip to content

Commit

Permalink
Implementing default content template.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamglenn committed Apr 7, 2024
1 parent 8268f3e commit 65210fb
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
6 changes: 6 additions & 0 deletions views/layouts/default.html
Expand Up @@ -83,6 +83,12 @@

{{ __TEMPLATE_CONTENT__ }}

{% if site.data.default_content_page_id != blank %}
{% assign defaultContent = site | get_page: site.data.default_content_page_id %}
{% assign slots = defaultContent.slots | where: 'where_to_display', 'as_full_width_block' %}
{% render "utilities/wvu-default-content-slots" defaultContent: defaultContent, slots: slots %}
{% endif %}

{% render "components/wvu-footer" scope: 'site' %}

{% link_javascript name: "vendor/bootstrap/bootstrap.bundle.min" %}
Expand Down
39 changes: 39 additions & 0 deletions views/utilities/_wvu-default-content-slots.html
@@ -0,0 +1,39 @@
{% comment %}<!-- Slots for context: {{ forContext | default: 'default' }} -->{% endcomment %}
{% if slots == blank and forContext != blank %}
{% assign slots = defaultContent.slots | where: 'where_to_display', forContext %}
{% endif %}

{% for slot in slots %}
{% if slot.value != blank and slot.custom == blank %}
{% case slot.value %}
{% when 'action-hero' %}{% render "components/wvu-action-hero" slot: slot %}
{% when 'action-hero-banner' %}{% render "components/wvu-action-hero-banner" slot: slot %}
{% when 'action-hero-card' %}{% render "components/wvu-action-hero-card" slot: slot %}
{% when 'action-hero-split' %}{% render "components/wvu-action-hero-split" slot: slot %}
{% when 'action-hero-two-column' %}{% render "components/wvu-action-hero-two-column" slot: slot %}
{% when 'cards' %}{% render "components/wvu-cards" slot: slot %}
{% when 'cards-w-overlay' %}{% render "components/wvu-cards-w-overlay" slot: slot %}
{% when 'columns' %}{% render "components/wvu-columns" slot: slot %}
{% when 'columns-1-2' %}{% render "components/wvu-columns-1-2" slot: slot %}
{% when 'columns-2-1' %}{% render "components/wvu-columns-2-1" slot: slot %}
{% when 'columns-2-1-1' %}{% render "components/wvu-columns-2-1-1" slot: slot %}
{% when 'contact-collection' %}{% render "components/wvu-contact-collection" slot: slot %}
{% when 'editable-region' %}{% render "components/wvu-editable-region" slot: slot %}
{% when 'featurettes' %}{% render "components/wvu-featurettes" slot: slot %}
{% when 'featurettes-cards' %}{% render "components/wvu-featurettes-cards" slot: slot %}
{% when 'hero' %}{% render "components/wvu-hero" slot: slot %}
{% when 'lede-text' %}{% render "components/wvu-lede-text" slot: slot %}
{% when 'page-collection' %}{% render "components/wvu-page-collection" slot: slot %}
{% when 'page-collection-icons' %}{% render "components/wvu-page-collection-icons" slot: slot %}
{% when 'people-collection' %}{% render "components/wvu-people-collection" slot: slot %}
{% when 'profile-hero' %}{% render "components/wvu-profile-hero" slot: slot %}
{% when 'profile-hero-w-quote' %}{% render "components/wvu-profile-hero-w-quote" slot: slot %}
{% when 'profile-teaser' %}{% render "components/wvu-profile-teaser" slot: slot %}
{% when 'quicklinks' %}{% render "components/wvu-quicklinks" slot: slot %}
{% when 'social-media' %}{% render "components/wvu-social-media" slot: slot %}
{% else %}ERROR: Unsupported component '{{ slot.value }}'
{% endcase %}
{% elsif slot.custom != blank %}
{% render "utilities/custom_components" slot: slot %}
{% endif %}
{% endfor %}

0 comments on commit 65210fb

Please sign in to comment.