2021-08-25 11:33:29 +00:00
|
|
|
+++
|
|
|
|
description = "Displays an expandable/collapsible section of text on your page"
|
|
|
|
title = "Expand"
|
|
|
|
+++
|
2017-08-20 15:10:29 +00:00
|
|
|
|
|
|
|
The Expand shortcode displays an expandable/collapsible section of text on your page.
|
2021-07-16 20:35:20 +00:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2021-08-23 21:32:34 +00:00
|
|
|
````go
|
2021-10-24 09:34:29 +00:00
|
|
|
{{%/* expand [ <string> [ "true" | "false" ] ] */%}}
|
2021-07-16 20:35:20 +00:00
|
|
|
Yes!
|
2021-07-16 21:51:11 +00:00
|
|
|
{{%/* /expand */%}}
|
2021-07-16 20:35:20 +00:00
|
|
|
````
|
|
|
|
|
2021-07-16 21:51:11 +00:00
|
|
|
The first optional parameter defines the text that appears next to the expand/collapse icon. The default text is `"Expand me..."`.
|
2021-07-16 20:35:20 +00:00
|
|
|
|
2021-07-16 21:51:11 +00:00
|
|
|
The second optional parameter controls if the block is initially shown as expanded (`"true"`) or collapsed (`"false"`). The default ist `"false"`.
|
2021-07-16 20:35:20 +00:00
|
|
|
## Examples
|
|
|
|
|
2021-09-03 22:50:08 +00:00
|
|
|
{{% expand "I'll tell you a secret..." %}}
|
|
|
|
...maybe the next time you'll open this expander!
|
|
|
|
{{% /expand %}}
|
|
|
|
|
2021-07-16 21:51:11 +00:00
|
|
|
### All defaults
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2021-07-16 21:51:11 +00:00
|
|
|
{{% expand %}}
|
2021-07-26 08:10:10 +00:00
|
|
|
Yes, you did it!
|
2021-07-16 21:51:11 +00:00
|
|
|
{{% /expand %}}
|
2021-07-16 20:35:20 +00:00
|
|
|
|
2021-07-26 08:10:10 +00:00
|
|
|
{{% expand "Show markup" "true" %}}
|
2021-08-23 21:32:34 +00:00
|
|
|
````go
|
2021-07-16 20:35:20 +00:00
|
|
|
{{%/* expand */%}}
|
2021-07-26 08:10:10 +00:00
|
|
|
Yes, you did it!
|
2021-07-16 20:35:20 +00:00
|
|
|
{{%/* /expand */%}}
|
|
|
|
````
|
2021-07-16 21:51:11 +00:00
|
|
|
{{% /expand %}}
|
|
|
|
|
|
|
|
### Initially expanded
|
|
|
|
|
|
|
|
{{% expand "Expand me..." "true" %}}
|
2021-07-26 08:10:10 +00:00
|
|
|
No need to press you!
|
2021-07-16 21:51:11 +00:00
|
|
|
{{% /expand %}}
|
|
|
|
|
2021-07-26 08:10:10 +00:00
|
|
|
{{% expand "Show markup" "true" %}}
|
2021-08-23 21:32:34 +00:00
|
|
|
````go
|
2021-07-16 21:51:11 +00:00
|
|
|
{{%/* expand "Expand me..." "true" */%}}
|
2021-07-26 08:10:10 +00:00
|
|
|
No need to press you!
|
2021-07-16 21:51:11 +00:00
|
|
|
{{%/* /expand */%}}
|
|
|
|
````
|
|
|
|
{{% /expand %}}
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2021-07-16 20:35:20 +00:00
|
|
|
### Arbitrary text
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2022-05-23 12:59:24 +00:00
|
|
|
{{% expand "Show me almost endless possibilities" %}}
|
2021-07-16 20:35:20 +00:00
|
|
|
Some expandable text.
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2022-05-23 12:59:24 +00:00
|
|
|
You can add standard markdown syntax:
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2021-07-16 20:35:20 +00:00
|
|
|
- multiple paragraphs
|
|
|
|
- bullet point lists
|
2021-07-26 08:10:10 +00:00
|
|
|
- _emphasized_, **bold** and even **_bold emphasized_** text
|
2021-07-16 20:35:20 +00:00
|
|
|
- [links](https://example.com)
|
|
|
|
- etc.
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2021-08-23 21:32:34 +00:00
|
|
|
```plaintext
|
2021-07-16 20:35:20 +00:00
|
|
|
...and even source code
|
|
|
|
```
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2022-05-23 12:59:24 +00:00
|
|
|
> the possiblities are endless (almost - including other shortcodes may or may not work)
|
2021-07-26 08:10:10 +00:00
|
|
|
{{% /expand %}}
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2021-07-16 20:35:20 +00:00
|
|
|
{{% expand "Show markup" %}}
|
2021-08-23 21:32:34 +00:00
|
|
|
````go
|
2022-05-23 12:59:24 +00:00
|
|
|
{{%/* expand "Show me almost endless possibilities" */%}}
|
2021-07-16 20:35:20 +00:00
|
|
|
Some expandable text.
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2022-05-23 12:59:24 +00:00
|
|
|
You can add standard markdown syntax:
|
2017-08-20 15:10:29 +00:00
|
|
|
|
2021-07-16 20:35:20 +00:00
|
|
|
- multiple paragraphs
|
|
|
|
- bullet point lists
|
2021-07-26 08:10:10 +00:00
|
|
|
- _emphasized_, **bold** and even **_bold emphasized_** text
|
2021-07-16 20:35:20 +00:00
|
|
|
- [links](https://example.com)
|
|
|
|
- etc.
|
|
|
|
|
2021-08-23 21:32:34 +00:00
|
|
|
```plaintext
|
2021-07-16 20:35:20 +00:00
|
|
|
...and even source code
|
|
|
|
```
|
|
|
|
|
2022-05-23 12:59:24 +00:00
|
|
|
> the possiblities are endless (almost - including other shortcodes may or may not work)
|
2021-07-16 20:35:20 +00:00
|
|
|
{{%/* /expand */%}}
|
|
|
|
````
|
2021-07-16 21:51:11 +00:00
|
|
|
{{% /expand %}}
|