From f240ced574d6f97a1279901532f5b4b3c44cc2ba Mon Sep 17 00:00:00 2001 From: Hannah De Wachter Date: Thu, 23 Nov 2023 16:54:05 +0100 Subject: [PATCH 1/2] Add alt text field to Assets --- config/project/project.yaml | 254 ++++++++++++------ ...-979c3eeb-f99a-4ca1-bcbe-ce9298a4e4ca.yaml | 23 ++ .../_content/_blocks/_callToAction.twig | 2 +- .../_snippet/_content/_blocks/_image.twig | 4 +- .../_snippet/_content/_blocks/_slider.twig | 2 +- .../_snippet/_content/_blocks/_textImage.twig | 4 +- 6 files changed, 198 insertions(+), 91 deletions(-) diff --git a/config/project/project.yaml b/config/project/project.yaml index 407ac36d..63c65e2c 100644 --- a/config/project/project.yaml +++ b/config/project/project.yaml @@ -1,7 +1,8 @@ -dateModified: 1699524009 +dateModified: 1700754763 elementSources: craft\elements\Entry: - - defaultSort: + - + defaultSort: - postDate - desc disabled: false @@ -12,9 +13,11 @@ elementSources: - dateUpdated - link type: native - - heading: General + - + heading: General type: heading - - disabled: false + - + disabled: false key: 'single:5611e98d-93ec-4bd4-95dd-18f282b8c5e8' # Home tableAttributes: - slug @@ -22,7 +25,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'section:45b7c78f-587d-441b-bbd1-605ca629d0bd' # Pages tableAttributes: - slug @@ -30,7 +34,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'single:5d236e94-b6a8-472c-9296-a5c992cdd49a' # Contact tableAttributes: - slug @@ -38,9 +43,11 @@ elementSources: - dateUpdated - link type: native - - heading: News + - + heading: News type: heading - - disabled: false + - + disabled: false key: 'single:4c32edae-2824-4f0f-b38b-2477d2500dfe' # News Overview tableAttributes: - slug @@ -48,7 +55,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'section:c576870d-abd8-46aa-8fe5-cdd12c40dfa8' # News tableAttributes: - slug @@ -56,9 +64,11 @@ elementSources: - dateUpdated - link type: native - - heading: Account + - + heading: Account type: heading - - disabled: false + - + disabled: false key: 'single:361daec5-5ea3-4d9f-957f-f39c78bb595e' # Profile tableAttributes: - slug @@ -66,7 +76,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'single:c25b1e19-dca6-4ab5-a776-a043f6ee4c82' # Login tableAttributes: - slug @@ -74,7 +85,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'single:684ece64-c23a-4abf-9574-f2c053d496e8' # Register tableAttributes: - slug @@ -82,7 +94,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'single:dca2ac05-7833-41de-b7b4-a737c090575c' # Confirm your account tableAttributes: - slug @@ -90,7 +103,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'single:d5601a1f-a33e-4c5a-b7af-1f29347149ca' # Registration completed tableAttributes: - slug @@ -98,7 +112,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'single:1c4e3f0f-ca9b-474d-a460-48f45133c763' # Forgot password tableAttributes: - slug @@ -106,7 +121,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'single:53c1af4c-0fbd-4811-a028-67fed65195b9' # Forgot Password Confirmation tableAttributes: - slug @@ -114,7 +130,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'single:8e583282-1fec-4444-822f-37b2d5961f28' # Set Password tableAttributes: - slug @@ -122,7 +139,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'single:4703bf34-5e13-4da1-aff6-d04c0bba024b' # Set Password Confirmation tableAttributes: - slug @@ -130,7 +148,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'single:05aba0e3-e1de-4bf3-8a07-5c9f3ef9475c' # Edit profile tableAttributes: - slug @@ -138,7 +157,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'single:af69e9a2-96df-4fa9-8cc3-2728ec4fc632' # Edit password tableAttributes: - slug @@ -146,9 +166,11 @@ elementSources: - dateUpdated - link type: native - - heading: Other + - + heading: Other type: heading - - disabled: false + - + disabled: false key: 'single:36895330-a28e-477f-9327-bdbe66dabf99' # Cookie policy tableAttributes: - slug @@ -156,7 +178,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'single:c2198cbb-f6e1-478a-ab4a-bbbaea43ce0e' # Privacy policy tableAttributes: - slug @@ -164,9 +187,11 @@ elementSources: - dateUpdated - link type: native - - key: 'single:99a435d2-9c12-4ef6-8b3b-2a9915d4216b' + - + key: 'single:99a435d2-9c12-4ef6-8b3b-2a9915d4216b' type: native - - disabled: false + - + disabled: false key: 'single:4750849d-9328-4d3e-956d-9d317da5e6eb' # Page not found tableAttributes: - slug @@ -174,7 +199,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'single:e3bed4e1-82ae-45e8-908c-0a6669141b31' # Search results tableAttributes: - slug @@ -182,7 +208,8 @@ elementSources: - dateUpdated - link type: native - - disabled: false + - + disabled: false key: 'single:fa6e0764-a31c-4304-a4d7-76bd3a679e3e' # 503 tableAttributes: - slug @@ -399,17 +426,23 @@ plugins: settings: elementDefaults: __assoc__: - - - craft\elements\Entry - - - dateCreated + - + - craft\elements\Entry + - + - dateCreated - author - dateUpdated - revisionCreator - link - - - craft\elements\Category - - - dateCreated + - + - craft\elements\Category + - + - dateCreated - dateUpdated - - - craft\elements\Asset - - - filename + - + - craft\elements\Asset + - + - filename - size - dateModified - uploader @@ -431,87 +464,138 @@ plugins: alertEmails: null captchas: __assoc__: - - - recaptcha - - __assoc__: - - - type + - + - recaptcha + - + __assoc__: + - + - type - verbb\formie\integrations\captchas\Recaptcha - - - enabled + - + - enabled - false - - - settings - - __assoc__: - - - handle + - + - settings + - + __assoc__: + - + - handle - recaptcha - - - secretKey + - + - secretKey - '' - - - siteKey + - + - siteKey - '' - - - type + - + - type - v3 - - - size + - + - size - normal - - - theme + - + - theme - light - - - badge + - + - badge - bottomright - - - language + - + - language - en - - - minScore + - + - minScore - '0.5' - - - projectId + - + - projectId - '' - - - hcaptcha - - __assoc__: - - - type + - + - hcaptcha + - + __assoc__: + - + - type - verbb\formie\integrations\captchas\Hcaptcha - - - enabled + - + - enabled - false - - - settings - - __assoc__: - - - handle + - + - settings + - + __assoc__: + - + - handle - hcaptcha - - - secretKey + - + - secretKey - '' - - - siteKey + - + - siteKey - '' - - - size + - + - size - normal - - - theme + - + - theme - light - - - language + - + - language - en - - - minScore + - + - minScore - '0.5' - - - duplicate - - __assoc__: - - - type + - + - duplicate + - + __assoc__: + - + - type - verbb\formie\integrations\captchas\Duplicate - - - enabled + - + - enabled - false - - - settings - - __assoc__: - - - handle + - + - settings + - + __assoc__: + - + - handle - duplicate - - - honeypot - - __assoc__: - - - type + - + - honeypot + - + __assoc__: + - + - type - verbb\formie\integrations\captchas\Honeypot - - - enabled + - + - enabled - true - - - settings - - __assoc__: - - - handle + - + - settings + - + __assoc__: + - + - handle - honeypot - - - javascript - - __assoc__: - - - type + - + - javascript + - + __assoc__: + - + - type - verbb\formie\integrations\captchas\Javascript - - - enabled + - + - enabled - true - - - settings - - __assoc__: - - - handle + - + - settings + - + __assoc__: + - + - handle - javascript - - - minTime + - + - minTime - '' defaultDateDisplayType: '' defaultDateTime: null diff --git a/config/project/volumes/publicFiles--979c3eeb-f99a-4ca1-bcbe-ce9298a4e4ca.yaml b/config/project/volumes/publicFiles--979c3eeb-f99a-4ca1-bcbe-ce9298a4e4ca.yaml index 42d4c70f..884caa05 100644 --- a/config/project/volumes/publicFiles--979c3eeb-f99a-4ca1-bcbe-ce9298a4e4ca.yaml +++ b/config/project/volumes/publicFiles--979c3eeb-f99a-4ca1-bcbe-ce9298a4e4ca.yaml @@ -38,6 +38,29 @@ fieldLayouts: userCondition: null warning: null width: 100 + - + attribute: alt + class: null + cols: null + disabled: false + elementCondition: null + id: null + instructions: null + label: null + name: null + orientation: null + placeholder: null + readonly: false + requirable: true + required: false + rows: null + tip: null + title: null + type: craft\fieldlayoutelements\assets\AltField + uid: 613a44f5-6a37-4c31-9640-88cb393cb476 + userCondition: null + warning: null + width: 100 - elementCondition: null fieldUid: 39f07216-d49a-4917-b05e-bec26f425843 # Image Caption diff --git a/templates/_site/_snippet/_content/_blocks/_callToAction.twig b/templates/_site/_snippet/_content/_blocks/_callToAction.twig index 5771ce0b..e2b77622 100644 --- a/templates/_site/_snippet/_content/_blocks/_callToAction.twig +++ b/templates/_site/_snippet/_content/_blocks/_callToAction.twig @@ -16,7 +16,7 @@ {{ image.imageCaption ?? image.title ?? entry.title }} diff --git a/templates/_site/_snippet/_content/_blocks/_image.twig b/templates/_site/_snippet/_content/_blocks/_image.twig index 4dee9076..c8788152 100644 --- a/templates/_site/_snippet/_content/_blocks/_image.twig +++ b/templates/_site/_snippet/_content/_blocks/_image.twig @@ -43,7 +43,7 @@ {% endif %} {% if image.extension == 'svg' or image.extension == 'gif' %} {{ image.imageCaption }} @@ -53,7 +53,7 @@ sizes="{{sizes}}" width="{{ optimizedImage.placeholderWidth }}" height="{{ optimizedImage.placeholderHeight }}" - alt="{{ image.imageCaption }}" + alt="{{ image.alt }}" class="w-full {% if block.showLargerVersionInPopup %}h-full object-cover{% endif %}" loading="lazy"/> {% endif %} diff --git a/templates/_site/_snippet/_content/_blocks/_slider.twig b/templates/_site/_snippet/_content/_blocks/_slider.twig index 733c2084..8e3ba6bf 100644 --- a/templates/_site/_snippet/_content/_blocks/_slider.twig +++ b/templates/_site/_snippet/_content/_blocks/_slider.twig @@ -20,7 +20,7 @@ srcset="{{ optimizedImage.srcset() }}" sizes="(max-width: 819px) 100vw, (min-width: 820px) 780px" width="{{optimizedImage.placeholderWidth}}" height="{{optimizedImage.placeholderHeight}}" - alt="{{ image.imageCaption }}" + alt="{{ image.alt }}" loading="lazy"/> diff --git a/templates/_site/_snippet/_content/_blocks/_textImage.twig b/templates/_site/_snippet/_content/_blocks/_textImage.twig index 0be9b299..686df9ba 100644 --- a/templates/_site/_snippet/_content/_blocks/_textImage.twig +++ b/templates/_site/_snippet/_content/_blocks/_textImage.twig @@ -14,14 +14,14 @@ {% if image.extension == 'svg' or image.extension == 'gif' %} {{ image.imageCaption }} {% else %} {{ image.imageCaption }} {% endif %} From ddd988919543a90f50ef3779253a1a0aa0ddaee0 Mon Sep 17 00:00:00 2001 From: Hannah De Wachter Date: Thu, 23 Nov 2023 16:54:35 +0100 Subject: [PATCH 2/2] Add instructions to Image caption and Image Credits --- ...eCaption--39f07216-d49a-4917-b05e-bec26f425843.yaml | 10 +++++----- ...opyright--bcf87482-b5f3-4be6-9a63-153f0458466b.yaml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/project/fields/imageCaption--39f07216-d49a-4917-b05e-bec26f425843.yaml b/config/project/fields/imageCaption--39f07216-d49a-4917-b05e-bec26f425843.yaml index 877f607d..0cc5ac3d 100644 --- a/config/project/fields/imageCaption--39f07216-d49a-4917-b05e-bec26f425843.yaml +++ b/config/project/fields/imageCaption--39f07216-d49a-4917-b05e-bec26f425843.yaml @@ -2,17 +2,17 @@ columnSuffix: null contentColumnType: text fieldGroup: 2c770290-8edc-4f26-b846-6d99d36d7844 # Common handle: imageCaption -instructions: '' +instructions: 'This will most likely be visible below the image' name: 'Image Caption' searchable: true settings: byteLimit: null charLimit: null - code: '' + code: false columnType: text - initialRows: '4' - multiline: '' - placeholder: 'description of the image' + initialRows: 4 + multiline: false + placeholder: null uiMode: normal translationKeyFormat: null translationMethod: site diff --git a/config/project/fields/imageCopyright--bcf87482-b5f3-4be6-9a63-153f0458466b.yaml b/config/project/fields/imageCopyright--bcf87482-b5f3-4be6-9a63-153f0458466b.yaml index 5ef0b48b..a5959fc7 100644 --- a/config/project/fields/imageCopyright--bcf87482-b5f3-4be6-9a63-153f0458466b.yaml +++ b/config/project/fields/imageCopyright--bcf87482-b5f3-4be6-9a63-153f0458466b.yaml @@ -2,17 +2,17 @@ columnSuffix: null contentColumnType: text fieldGroup: 2c770290-8edc-4f26-b846-6d99d36d7844 # Common handle: imageCopyright -instructions: '' +instructions: 'Credit of the image' name: 'Image Copyright' searchable: true settings: byteLimit: null charLimit: null - code: '' + code: false columnType: null - initialRows: '4' - multiline: '' - placeholder: 'Credit of the image' + initialRows: 4 + multiline: false + placeholder: null uiMode: normal translationKeyFormat: null translationMethod: site