Provus Logo

Starter Site for Component-Based Site Building

This project is maintained by Promet Source logo

Creating a New Component for the Link Group

The Link Group is a block that offers several view modes as well as content types for placing widgets.

Steps for creating a new component for the link group include:

Component Library

1. Create a card in the component library

In the site theme, create a new card by following the example in the card folder of the component library.

2. Create a new wrapper for the card

This step is only neccarsy if the card can only be used in certain contexts that require a wrapper around it. This is true for components that use Javascript like a carousel.

See the Groups as an example. The group or other template should embed the card itself. See multi-card as an example.

Drupal Development

3. Create View Mode

Create a new view mode for the card at /admin/structure/display-modes/view in the Content area.

4. Add the View Mode to the Content Types and Inline Item Block

Each content type exposed in the Link Group needs to implement the new view mode. It should include the fields necessary for the desired output.

Additionally a view mode should be added to the Inline item block.

Add the card wrapper or group to the list of group displays.

6. Add the group dispaly to theme_override_item_display()

Add the display id from “#5” to theme_override_item_display() and select the desired card for that display.

Drupal Theming

7. Create template for the card

Create a template for the inline item block for the card. See card borderd as an example.

See Carousel Multi for an example.