Accordion Sections
Add collapsible accordion sections to your pages
Collapsible accordion sections can be a great way to help readers access the content of an otherwise long page quickly, or to tuck away content that might be an aside or sidebar to what is being said in the text. You can create these sections anywhere in a Quire project with the {% accordion %}
shortcode. Also available is the {% accordionGlobalControls %}
shortcode which adds “Expand/Collapse All” links to any page with accordions on it.
{% accordion %}
Parameters: <heading text>
, <custom id>
, <open>
{% accordion '## Section One' 's1' 'open' %}
...
{% endaccordion %}
{% accordionGlobalControls %}
Parameters: none
{% accordionGlobalControls %}
Wrap Content in the Accordion Shortcode
The {% accordion %}
shortcode is a “paired” shortcode and so requires an opening and closing tag surrounding the text you want to be hidden.
Also required is a brief heading text that will become the link that expands and collapses the section. Markdown can be used in the heading text, and it will often be some level of heading. ## Section One
is the heading text in the example below.
{% accordion '## Section One' %}
...
{% endaccordion %}
Markdown can also be used in the text within the section, as can shortcodes such as {% figure %}
and even other {% accordion %}
sections.
{% accordion '## Section One' %}
This is the text that will be hidden. It can include **markdown** formatting,
footnotes, and other shortcodes.[^1]
{% figure 'fig-01' %}
{% endaccordion %}
| words