{% load django_cards_tags %}{# The folding sections of an add_sections() card, shared by both packs (none of it is #} {# Bootstrap-version-specific). `sections` is a list of cards.base.CardSection; include this #} {# with sections=build_sections(cards) to put a stack inside a template of your own -- the #} {# card stylesheet and the toggle's script come with it, each once per request. #} {% if sections %}{% card_css %}{% section_stack_script %} {% section_stack_id sections as stack_dom_id %}
{% for section in sections %}
{{ section.render_header }}
{{ section.render_body }}
{% endfor %}
{# Guarded: the script comes with the first stack rendered, which may sit later on the page. A #} {# fresh stack's markup already carries its folds; this only matters after a redraw. #} {% endif %}