Skip to content
Snippets Groups Projects
Commit 57fcc323 authored by Jennifer Dust's avatar Jennifer Dust
Browse files

Issue #3413130 by jldust, pdureau: SDC components: Fix JSON schema usage

parent a3ffb336
No related branches found
Tags 10.0.2
1 merge request!94Issue 3413130 - Updating Teaser component and the breadcrumb component
......@@ -12,9 +12,9 @@ props:
items:
type: object
properties:
title:
text:
type: string
title: Title
title: Text
examples:
- "Home"
url:
......
title: Breadcrumb
args:
items:
- title: "Home"
url: "/"
- text: 'Home'
url: '/'
current: false
- title: "Events"
url: "/events"
- text: 'Events'
url: '/events'
current: false
- title: "Event example title"
url: "/event/test"
- text: 'Event example title'
url: '/event/test'
current: true
stories:
- name: Default
<nav aria-label="Breadcrumb" {{ attributes.addClass('c-breadcrumb') }}>
<nav role='navigation' aria-label='Breadcrumb' {{ attributes.addClass('c-breadcrumb') }}>
{% block breadcrumbs_block %}
<ol class="c-breadcrumb__list">
{% for item in items %}
{% if item.is_current_page == true %}
<li class="c-breadcrumb__item">
<a href="{{item.url}}" aria-current="page">{{item.title}}</a>
</li>
{% else %}
<li class="c-breadcrumb__item">
<a href="{{item.url}}">{{item.title}}</a>
</li>
{% endif %}
{% endfor %}
</ol>
<ol class='c-breadcrumb__list'>
{% for item in items %}
{% if item.is_current_page == true %}
<li class='c-breadcrumb__item'>
<a href="{{item.url}}" aria-current='page'>{{item.text}}</a>
</li>
{% else %}
<li class='c-breadcrumb__item'>
<a href="{{item.url}}">{{item.text}}</a>
</li>
{% endif %}
{% endfor %}
</ol>
{% endblock %}
</nav>
File moved
$schema: https://git.drupalcode.org/project/sdc/-/raw/1.x/src/metadata.schema.json
name: Teaser
status: "experimental"
status: 'experimental'
description: A Teaser component
props:
type: object
......@@ -18,37 +18,35 @@ props:
- list-stack
- super
alt:
type: "string"
title: "Image Alt Text"
description: "The alt text for the image."
type: 'string'
title: 'Image Alt Text'
description: 'The alt text for the image.'
examples:
- "Ea irure adipisicing"
- 'Ea irure adipisicing'
image:
type: "string"
title: "image URL"
description: "The url for the image"
examples:
- ""
type: 'string'
title: 'image URL'
description: 'The url for the image'
title:
type: "string"
title: "Title"
type: 'string'
title: 'Title'
examples:
- "A new exhibit opens at the Student Visitor Center"
- 'A new exhibit opens at the Student Visitor Center'
url:
type: "string"
title: "Teaser URL"
type: 'string'
title: 'Teaser URL'
examples:
- "https://github.com"
- 'https://github.com'
category:
type: "string"
title: "Category"
type: 'string'
title: 'Category'
examples:
- "Article"
- 'Article'
category_url:
type: "string"
title: "Category URL"
type: 'string'
title: 'Category URL'
examples:
- "https://github.com"
- 'https://github.com'
category_color:
type: string
title: Category Color
......@@ -58,20 +56,20 @@ props:
- kelly
- gold
teaser_date:
type: "string"
title: "Date"
type: 'string'
title: 'Date'
examples:
- "August 18, 2024"
- 'August 18, 2024'
teaser_time:
type: "string"
title: "Time"
type: 'string'
title: 'Time'
examples:
- "4:00pm - 6:00pm"
- '4:00pm - 6:00pm'
body:
title: Body
type: string
examples:
- "<p>The human body is a marvel and does so amazing things for us everyday.</p>"
- '<p>The human body is a marvel and does so amazing things for us everyday.</p>'
icon:
type: string
title: Category icon
......@@ -80,18 +78,18 @@ props:
tags:
type: array
title: Tags
tags:
items:
type: object
properties:
title:
type: string
title: Title
examples:
- "Tag one"
- "Tag two"
url:
type: string
title: Tag URL
examples:
- https://github.com
- https://github.com
title:
type: string
title: Title
examples:
- 'Tag one'
- 'Tag two'
......@@ -108,7 +108,7 @@
{% block tags_block %}
{% for key, tag in tags %}
<li class="c-teaser__tag">
<a href="{{tag.title}}">{{tag.title}}</a>
<a href="{{tag.url}}">{{tag.title}}</a>
</li>
{% endfor %}
{% endblock %}
......
{{
include('prototype:breadcrumbs', {
breadcrumbs: breadcrumbs,
separator: '|',
items: breadcrumb,
})
}}
......@@ -17,9 +17,11 @@
{# /header #}
{% if breadcrumb %}
{{ include('prototype:breadcrumbs', {
breadcrumbs: page.breadcrumb,
}) }}
{{
include('prototype:breadcrumbs', {
items: breadcrumbs,
})
}}
{% endif %}
{# /breadcrumb #}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment