Skip to content

Commit

Permalink
Simplify fallbacks, more lazy-eager-loading
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustMiller committed Feb 7, 2024
1 parent 1ec2d5e commit b0ac985
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 14 deletions.
17 changes: 14 additions & 3 deletions src/css/components/blocks/rich-text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,21 @@
}

figure {
margin: 10px 0 30px 0;
width: 100%;
margin: 10px 0 30px;
background-color: #f7f7f7;
box-shadow: 0px 70px 50px -50px rgba(0,0,0,0.2);

img, picture {
background-color: #f7f7f7;
box-shadow: 0px 70px 50px -50px rgba(0,0,0,0.2);
}

figcaption {
font-family: 'EuropaSansRegular', sans-serif;
font-size: 12px;
margin: 10px auto 0 auto;
max-width: 500px;
text-align: center;
}
}

&.layout-imageFullWidth figure {
Expand Down
2 changes: 1 addition & 1 deletion templates/_/components/block-matrix.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set contentBlocks = contentBlocks ?? null ? contentBlocks : entry.contentBlocks.all() %}
{% set contentBlocks = contentBlocks ?? entry.contentBlocks.all() ?? [] %}

{% if contentBlocks | length %}

Expand Down
2 changes: 1 addition & 1 deletion templates/_/components/blocks/imageAndHeadings.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% set isFirst = isFirst ? 'isFirst' : '' %}

{% set image = theBlock.image.eagerly().one() ?? null %}
{% set image = theBlock.image.eagerly().one() %}
{% set textColor = theBlock.textColor | default('#000') %}
{% set highlightText = theBlock.highlightText ? 'is-highlighted' : '' %}

Expand Down
8 changes: 4 additions & 4 deletions templates/_/components/blocks/slider.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{# @var craft \craft\web\twig\variables\CraftVariable #}

{% set ctaLinkText = theBlock.ctaLinkText %}
{% set ctaLink = theBlock.ctaLink.eagerly().one().url ?? null %}
{% set ctaLink = theBlock.ctaLink.eagerly().one() %}
{% set slideImages = theBlock.slideImages.eagerly().all() %}
{% set slideEntries = theBlock.slideEntries.eagerly().all() %}
{% set slideLayoutCentered = theBlock.slideLayoutCentered %}
Expand All @@ -12,9 +12,9 @@
<div class="slider-info">

<div class="slider-link-container hide-on-tablet">
<a class="slider-link active" href="{{ ctaLink }}">
{{ ctaLinkText }}
</a>
{% if ctaLink %}
<a class="slider-link active" href="{{ ctaLink.url }}">{{ ctaLinkText }}</a>
{% endif %}
</div>

<h4 class="slider-heading {% if not theBlock.heading %}hide-on-tablet{% endif %}">
Expand Down
2 changes: 1 addition & 1 deletion templates/_/components/blocks/statsAndImage.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{# @var craft \craft\web\twig\variables\CraftVariable #}

{% set image = theBlock.image.one() ?? null %}
{% set image = theBlock.image.eagerly().one() %}

<div class="content-block stats-and-image-block {{ isFirst }}" data-scroll-section>

Expand Down
2 changes: 1 addition & 1 deletion templates/_/pages/about.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% block content %}

{% set heroTitle = entry.heroTitle | default(entry.title) %}
{% set heroImage = entry.heroImage.one() ?? null %}
{% set heroImage = entry.heroImage.one() %}

<article data-router-view="about" data-handle="{{ entry.type.handle }}">

Expand Down
2 changes: 1 addition & 1 deletion templates/_/pages/contact.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{{ entry.title }}
</h1>

{% set heroImage = entry.heroImage.one() ?? null %}
{% set heroImage = entry.heroImage.one() %}

{% if heroImage %}

Expand Down
2 changes: 1 addition & 1 deletion templates/_/pages/exhibitions.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{{ entry.title }}
</h1>

{% set heroImage = entry.heroImage.one() ?? null %}
{% set heroImage = entry.heroImage.one() %}

{% if heroImage %}

Expand Down
2 changes: 1 addition & 1 deletion templates/_/pages/visit.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{{ entry.title }}
</h1>

{% set heroImage = entry.heroImage.one() ?? null %}
{% set heroImage = entry.heroImage.one() %}

{% if heroImage %}

Expand Down

0 comments on commit b0ac985

Please sign in to comment.