From f3d63e1ce8013d3b0d507b0f6f86fe5b15df1c13 Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 18 Mar 2021 00:59:31 +0100 Subject: [PATCH] improve image meta --- content/contents.lr | 6 ++++++ flowblocks/flow_text_image_section.ini | 19 +++++++++++++++++++ templates/blocks/flow_text_image_section.html | 16 ++++++++-------- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/content/contents.lr b/content/contents.lr index 9704628..7213626 100644 --- a/content/contents.lr +++ b/content/contents.lr @@ -35,4 +35,10 @@ title: Mastodon sm_link: https://chaos.social/@hackergeno ----- sm_image: /images/mastodon_logo.svg +---- +content_image: nasa-space-shuttle.jpg +---- +content_image_alt: Startendes Space Shuttle +---- +content_image_src: images.nasa.gov/details-sts057-s-055 #### flow_seperator #### diff --git a/flowblocks/flow_text_image_section.ini b/flowblocks/flow_text_image_section.ini index 053be29..5daa9d7 100644 --- a/flowblocks/flow_text_image_section.ini +++ b/flowblocks/flow_text_image_section.ini @@ -19,3 +19,22 @@ type = markdown label = Content footer type = flow flow_blocks = flow_social_media_link + +[fields.content_image] +label = Content Image +description = Upload a Image to select it here +type = select +source = record.attachments.images +width = 1/2 + +[fields.content_image_alt] +label = Content Image ALT tag +description = Description of the Image +type = string +width = 1/4 + +[fields.content_image_src] +label = Content Image Source +description = Woher kommt das Bild (Optional) +type = string +width = 1/4 diff --git a/templates/blocks/flow_text_image_section.html b/templates/blocks/flow_text_image_section.html index a828da1..b57fecf 100644 --- a/templates/blocks/flow_text_image_section.html +++ b/templates/blocks/flow_text_image_section.html @@ -19,11 +19,10 @@ {% endfor %} -{# - {% if this.attachments.images %} + {% if this.content_image %}
- {% for image in this.attachments.images %} - - Startendes Space Shuttle - {% endfor %} + #} + {{ this.content_image_alt }} + {% if this.content_image_src is defined and this.content_image_alt != '' %} +

{{ this.content_image_src }}

+ {% endif %}
{% endif %} -#}