paragraph type cards - NCIOCPL/cgov-digital-platform GitHub Wiki
Cards can be used within paragraph containers, as well as inline in body copy.
There are different types of cards:
This is used for both Primary feature, Secondary feature and thumbnail cards to promote content from within the site.
- Display Name: Promo Card
- Machine-readable Name: cgov_card_internal
- Description: Feature content in a card display.
-
Featured Item
- Field Name: field_featured_item
- Label: Featured Item
-
Type: Entity Reference
- Use Content Browser
-
Allowed Types:
- Nodes - If we limit the types, then we will have issues with sub-profiles needing to control what is allowed. So we should NOT limit the Node type - then it will allow whatever types exist in the profile.
- Required: Yes
- Max characters: N/A
- Tooltip Text:
- Cardinality: 1
- Translatable: No
- Featured Item
- Override Card Title
- Override Card Description
- Override Promotional Image
This is used for both Primary and Secondary feature cards to promote content outside of the site. NOTE: This uses the same override fields as Internal Promotional Cards to hopefully simplify templates used for the cards.
- Display Name: External Promo Card
- Machine-readable Name: cgov_card_external
- Description: Featured external content in a card display.
-
Featured Item Url
- Field Name: field_featured_url
- Label: Featured Item Url
- Type: Text
- Required: Yes
- Max characters: N/A
- Tooltip Text:
- Cardinality: 1
- Translatable: No
- Featured Item URL
- Card Title
- Card Description
- Promotional Image
This is used for the multimedia card.
- Display Name: Multimedia Card
- Machine-readable Name: cgov_card_multimedia
- Description: Multimedia card with player.
Featured Media
- Field Name: field_featured_media
- Label: Featured Media
-
Type: Entity Reference
- Use Content Browser
-
Allowed Types:
- Media - This should only be the core media types that have pages.
- Required: Yes
- Max characters: N/A
- Tooltip Text:
- Cardinality: 1
- Translatable: No
- Featured Media
Media items display mostly the same ways as the internal and external links, the difference is that the title contains information about the media type or file information.
All titles are either the Name of the media item, or the Override Title.
Only the title portion of the link is clickable and responds to hover - the media type does not.
English
<Infographic Title> (Infographic)
Spanish
<Infographic Title> (Infografía)
English
<Video Title> (Video)
Spanish
<Video Title> (Video)
English and Spanish
<File Title> (<icon or filetype>) (<Size> <unit>)
- Like with other media types, the title is the clickable link (icon and size are not included in the link)
- If the file is .html or .htm then the title displays only as
<File Title>
- Only these icons are available for display - any other extensions show as . (and have no icon)
- MS Word (.doc and .docx)
- MS Excel (.xls and .xlsx)
- MS Powerpoint (.ppt and .pptx)
- mobi
- epub
- exe
- txt
- For the file size, use these rules
- Round the file size to the nearest integer.
- Display the file size in bytes if the file size is less than 1 KB.
- Display the file size in KB if the file size is less than 1 MB.
- Display the file size in MB if the file size is more than 1 MB.