Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

Penyaskito: Canvas Tips&Tricks: Declaring images in SDCs

Дата публикации: 18-07-2026 15:43:15

Canvas Tips&Tricks: Declaring images in SDCs
I've read recently about making SDCs dependent on Drupal Canvas because of needing to reference Canvas in the definition of your prop, so the right media widget is used inside Canvas:
image:
$ref: json-schema-definitions://canvas.module/image
type: object
title: Image
description: >
Image of the singer
examples:
- src: 'micro.webp'
alt: 'Nice picture of the singer'
width: 200
height: 300That was the case during the alphas. But was fixed long ago, even before the 1.0.0 release. See canvas#3515074.
image:
type: object
title: Image
required: [src]
properties:
src:
type: string
format: uri-reference
contentMediaType: "image/*"
x-allowed-schemes: [http, https] # this is image-uri, itself a nested $ref
alt: { type: string }
width: { type: integer }
height: { type: integer }
description: >
Image of the singer
examples:
- src: 'micro.webp'
alt: 'Nice picture of the singer'
width: 200
height: 300That's more verbose, but would make your SDC Canvas-independent and re-usable, and it's 100% equivalent. 
If we missed updating some docs, please create an issue on the Canvas issue queue.

penyaskito
Sat, 07/18/2026 - 17:43
Tags

Drupal
Drupal Canvas
Drupal Canvas Tips&Tricks
Single-Directory Components
Drupal planet

Read more about Canvas Tips&Tricks: Declaring images in SDCs
Add new comment

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1DDEV Blog: DDEV July 2026: New Screencasts, Partner Perks5716-07-2026
2Droptica: What to do after Drupal 7: new website, Drupal 11 migration, or another CMS?0716-07-2026
3BloomIdea: Make-to-Order production for Drupal Commerce: from a spreadsheet to a contrib module0518-07-2026
4ERC-8100: Representable Contract State0508-07-2026
5LakeDrops Drupal Consulting, Development and Hosting: A new chapter for the Drupal Association - and why I want you in it0517-07-2026
6Centarro: Let Shoppers Change Their Minds Without Leaving the Cart2615-07-2026
7carpet imprints0113-07-2026
8Github repo pghqdev/OpenScreenShot0509-07-2026
9What's New? Rule-Driven Architectural Products in the Browser with Informed Design's APS Viewer Extension5618-03-2026
10Parameter display conditions (hide element when empty)0510-07-2026

Классификация: Пресс-релизы. Схожих патентов: 0. Схожих новостей: 10. Тональность: 0. Информативность: 5. Источник: www.drupal.org.