- Issue created by @adanbouzoua
- e0ipso Can Picafort
You are not supposed to write JSON files with stories, please check the documentation for more info.
Automatically closed - issue fixed for 2 weeks with no activity.
testing basic SDC + Storybook implementation
I am getting "Cannot read properties of undefined (reading 'URL')
I am using barebone Drupal 10.3.3 card as test component of Umami theme
card.twig
{# themes/custom/mytheme/components/card/card.twig #}
<div class="card-component">
<h2>{{ card_title }}</h2>
<div class="card-text">{{ card_text | raw }}</div>
{% if card_link is defined and card_link.url %}
<a href="{{ card_link.url }}" class="ali-link">{{ card_link.title }}</a>
{% endif %}
</div>
card.stories.json
$schema: https://git.drupalcode.org/project/drupal/-/raw/HEAD/core/assets/schemas/v1/metadata.schema.json
title: 'Card Component'
status: true
description: 'A simple example component for Drupal Storybook.'
hidden: false
fields:
title:
type: string
label: 'Title'
description:
type: string
label: 'Description'
link:
type: link
label: 'Link'
fields:
title:
type: string
label: 'Link Title'
url:
type: string
label: 'Link URL'
card.component.yml
# This is so your IDE knows about the syntax for fixes and autocomplete.
$schema: https://git.drupalcode.org/project/drupal/-/raw/HEAD/core/assets/schemas/v1/metadata.schema.json
# The human readable name.
name: Card
# Status can be: "experimental", "stable", "deprecated", "obsolete".
status: experimental
# Schema for the props. We support www.json-schema.org. Learn more about the
# syntax there.
props:
type: object
properties:
attributes:
type: Drupal\Core\Template\Attribute
title: Attributes
description: Wrapper attributes.
html_tag:
type: string
title: HTML tag for wrapper
# Limit the available options by using enums.
enum:
- article
- div
# Provide a default value
default: article
# Slots always hold arbitrary markup. We know that beforehand, so no need for
# a schema for slots.
slots:
# The key is the name of the slot. In your template you will use
# {% block content %}.
content:
title: Content
required: true
description: The card content.
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
Active
1.0
Storybook
You are not supposed to write JSON files with stories, please check the documentation for more info.
Automatically closed - issue fixed for 2 weeks with no activity.