From 248ea4d7dbdaa8c477468dc3cdce5d20fd733e43 Mon Sep 17 00:00:00 2001 From: Julian Pustkuchen <3110-Anybody@users.noreply.drupalcode.org> Date: Fri, 5 Jan 2024 08:09:32 +0000 Subject: [PATCH] Issue #3356080: Add lazy loading parameter to drupal_image() or add attribute example in Cheat Sheet --- docs/cheat-sheet.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/cheat-sheet.md b/docs/cheat-sheet.md index c040026..f4df018 100644 --- a/docs/cheat-sheet.md +++ b/docs/cheat-sheet.md @@ -114,6 +114,11 @@ options, which is documented here: https://api.drupal.org/api/drupal/core!lib!Dr {# Render image using 'thumbnail' image style and custom attributes. #} {{ drupal_image('public://ocean.jpg', 'thumbnail', {alt: 'The alternative text'|t, title: 'The title text'|t}) }} +{# Render image using 'thumbnail' image style with lazy/eager loading (by attribute). #} +{{ drupal_image('public://ocean.jpg', 'thumbnail', {loading: 'lazy'}) }} +{{ drupal_image('public://ocean.jpg', 'thumbnail', {loading: 'eager'}) }} + +{# Render responsive image. #} {# Render responsive image (using a named argument). #} {{ drupal_image('public://ocean.jpg', 'wide', responsive=true) }} ```