This documentation refers to a Gravstrap obsolete release. Please consider to upgrade to the new release

The Gravstrap List group component handles the Bootstrap List group component.

The listgroup component is defined by the following Yaml code:

gravstrap:
    listgroup:
        listgroup1:
            from_file: listgroup.markdown
            items:
                0:
                    url: "#"
                    active: true
                    badge: 12
                    #type : success / info / warning / danger
                    section: listgroup1
                1:
                    url: "#"
                    #active: true
                    #disabled: true
                    section: listgroup2

This code must be added to the page where you need to display the component.

from_file property

The from_file mandatory property defines the file which contains the contents for each listgroup item. This file must be added under the page where the component is displayed and it is structured as follows:

[SECTION listgroup1]

Dapibus ac facilisis in

[/SECTION]

[SECTION listgroup2]

### List group item heading 2
Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.

[/SECTION]

Each section name is related to the item who displays the content of the section itself.

items property

The items property is an array which defines the elements displayed in the list group component.

item's url property

The url mandatory property defines the url connected to the item.

item's active property [optional]

The active optional property activates the item.

item's badge property [optional]

The badge optional property adds the specified text as a badge.

item's type property [optional]

The type optional property defines the item type. You can choose one from the following accepted values: danger, success, info, warning.

item's disabled property [optional]

The disabled optional property disables the item.

item's section property

The section property defines the item section name where it is defined the list group content.

Render the List group component

Add the following code to the template where you need to render the list group component:

{{ gravstrap.listgroup1 }}

Next Post Previous Post