-
Notifications
You must be signed in to change notification settings - Fork 5
Component Request - Definition List #684
Description
Component Description
A component that displays metadata key-value fields as a definition list. It displays n number of metadata fields in either a vertical (stacked) or horizontal (tabular/column) orientation.
Note: Because metadata shape/structure cannot be predicted (single vs nested values, etc), and to keep this component agnostic/generic, data for this component should be parsed/formatted at parent component or page level.
I have mocked out scenarios in this Stackblitz pen/preview.
For the FTVA website build, this component will be used on the Collection Item Detail page to display the main article's metadata content in the sidebar.
Collection Detail Walkthrough: YouTube
Design Specs
Slots
- For
View Catalog Recordbutton or supporting/secondary component - Inside the
dltag, two slots for thedtandddtags; so that parent component/consumer can decide how to display the key-value pairs (for example: with icons, as buttons, as linked text, etc.)
Props
Depending on approach for how to format data that this component will use, metadataList can be an array of arrays (of each field's stringified key-value pairs) or an array of objects (each field)
props: {
metadataList: {
type: Array,
default: []
},
orientation: { // triggers CSS styling for vertical or horizontal layout
type: String,
default: "vertical"
},
}
Developer Tips
- Use the
Description Listelement (MDN) - There should be no data parsing at the component level; see note and Stackblitz demo at the top
- Demo / parse data in Storybook:
titlemetadata field should not be displayed (per walkthrough discussion)- Empty metadata fields should not be displayed (per walkthrough discussion)
- Metadata fields with multiple items should display items as comma separated values (ref: Slack thread)
- Add slots to component; see
Slotsnote above
- For FTVA implementation, button link for:
View Catalog Recordcomes from theexternalResourceUrlfield
- Make the component full width/size agnostic; actual sizing should be determined by a parent container
- For FTVA's Collection Item Detail page, the parent container will be the sidebar column
- Responsiveness: default
verticalorientation is mobile-friendly;horizontalorientation can be left as is until its use case is needed and/or [future] design specs are provided.
FTVA Data
- View metadata fields in Craft:
- https://test-craft.library.ucla.edu/admin/entries/ftvaItemInCollection/3102779-as-above-so-below#tab--metadata
- https://test-craft.library.ucla.edu/admin/entries/ftvaItemInCollection/3696632-test-collection-item-for-archive-events-audio-recordings-2#tab--metadata
- View sample raw metadata
- Query to run for sample/test data:
query FTVACollectionItem($collectionSlug: [String!], $slug: [String!]) {
entry(section: "ftvaItemInCollection", slug:$slug ) {
id
title
slug
sectionHandle
ftvaAssociatedCollections {
id
title
}
ftvaImage {
...Image
}
videoEmbed
richText
externalResourceUrl
ftvaDate
releaseDate
episodeAirDate
episodeTitle
episodeSeason
episodeNumber
ftvaCollectionGroup {
... on ftvaCollectionGroup_Category {
id
title
}
}
ftvaCollectionTags {
... on ftvaCollectionTags_Tag {
id
title
}
}
director {
... on ftvaLARebellionIndividual_ftvaLARebellionIndividual_Entry {
nameFirst
nameLast
}
}
year
country
runtime
associatedIndividuals {
... on associatedIndividuals_individual_BlockType {
individual {
id
nameFirst
nameLast
}
roles
}
}
}
Events
No event to emit
Child components
- No direct child component; but for the slot (at story/parent level) use the
ButtonLinkcomponent (FTVA Secondary)



