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

The Gravstrap Collapse component handles the Bootstrap Collapse component.

The collapse component is defined by the following Yaml code:

            #from_file: collapse.markdown 
            id: collapseExample 
            tag: a | button
            button_caption: Read me
            body: Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus...

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

from_file property

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

[SECTION body]

### Collapse
Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.


This file must contain a single section called body.

If you need to add more collapses and you want to define for each collapse a markdown content, you must add a markdown file for all the collapses you want to handle.

id property

The id mandatory property defines the same HTML property for the collapse. If you need more than one collapse on the same page, be sure to add a different id for each collapse you define.

tag property

The tag mandatory property defines the element which toggles the collapse. Valid values are a and button.

button_caption property

The button_caption property defines the toggle element's caption.

body property [optional]

The body property defines a simple content for the collapse body. When you define both the body and the from_file properties, the latter one is ignored.

Render the collapse component

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

{{ gravstrap.collapse1 }}

Next Post Previous Post