Syntax error in code example with image component

Created on 8 October 2025, 25 days ago

Overview

This example in the docs has a syntax error: https://project.pages.drupalcode.org/canvas/sdc-components/image/#usage-...

{% include 'canvas:image' with image|merge({
  loading: 'lazy',
  sizes: '(max-width: 768px) 100vw, 50vw',
  class: 'card--image',
  attributes: create_attribute({
    'data-testid': 'card-component-image',
  }),
} only %}

It's missing a ) right before the only. So it should be

{% include 'canvas:image' with image|merge({
  loading: 'lazy',
  sizes: '(max-width: 768px) 100vw, 50vw',
  class: 'card--image',
  attributes: create_attribute({
    'data-testid': 'card-component-image',
  }),
}) only %}

Proposed resolution

User interface changes

🐛 Bug report
Status

Active

Version

1.0

Component

Documentation

Created by

🇺🇸United States mherchel Gainesville, FL, US

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024