Provide a link SDC schema similar to image SDC

Created on 11 December 2024, 4 months ago

Overview

One of my component uses a Drupal link. I would like to be able to just refer to a link type in my SDC component yml similar to what you did with image component. Here is my cta.component.yml

$schema: https://git.drupalcode.org/project/drupal/-/raw/10.1.x/core/modules/sdc/src/metadata.schema.json
name: CTA
status: stable
props:
  type: object
  properties:
    title:
      type: string
      title: 'Title'
      description: 'Main title'
    body:
      type: string
      title: 'Body'
      description: 'Main content text'
    links:
      type: string
      title: 'Links'
      description: 'Rendered links as HTML'

And in my template, i have this

    {% embed 'provus_blocks:cta' with {
      subtitle: content.field_provus_sub_title|render,
      title: content.field_provus_title|render,
      links: content.field_provus_links|render
    } only %}
    {% endembed %}

Proposed resolution

Create a schema similar to components/image/image.component.yml for links.

User interface changes

Feature request
Status

Active

Version

0.0

Component

Config management

Created by

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

Comments & Activities

Production build 0.71.5 2024