By RTa_sub
Description
Speaking of multiple collapsibles, there's Boyu12's colmod.
I wanted to make a similar one, so I used the collapsible-block code to create multiple collapsibles.
The sooner you see it in action first, the better.
Demo1
Colalt is colalt itself…
Syntax
And the source code is different in the odd and even layers.
You must be wondering what are odd and even layers?
The first layer of colalt is the first layer, and when you nest the colalt in order, the second layer, the third layer, and so on.
In this case, the odd or even number of n in the n layer is determined by whether the n are odd layer or even layer.
Item name | Data type | Initial value | Description |
---|---|---|---|
oddtop | [ | null(none) | Add [ as described above. |
oddend | [ | null(none) | Add [ as described above. |
eventop | [ | null(none) | Add [ as described above. |
evenend | [ | null(none) | Add [ as described above. |
show | String | + show block | Open link text. |
hide | String | - hide block | Close link text. |
nohide | true,false | false | true will not display the close link. |
folded | true,false | true | false leaves it open and can be collapsed by the user at will. In this case, add f at the beginning of oddtop, eventop, oddend, and evenend. oddtop → foddtop eventop → feventop oddend → foddend evenend → fevenend This is a See Demo 4 for more information. |
Code
You can add/modify parameters as needed by enclosing the part you want to fold with the following colalt.
[[include :snippets:colalt |oddtop=[|show=+open|hide=-close]]
…
[[include :snippets:colalt |eventop=[|show=+open|hide=-close]]
…
[[include :snippets:colalt |evenend=[|show=+open|hide=-close|nohide=true]]
[[include :snippets:colalt |oddend=[|nohide=true]]
In action
Demo 2
If you omit nohide in oddend or evenend and set hide…
Demo 3
If you omit hide in oddtop or eventop and set nohide=true…
Demo 4
If you set folded=false…
You can reproduce the collapsible folded="no".
You need to convert it to
oddtop → foddtop
eventop → feventop
oddend → foddend
evenend → fevenend .
You can reproduce the collapsible folded="no".
[[include :snippets:colalt |foddend=[|folded=false|show=+ open|nohide=true]]
Demo 5
If you enclose a colalt with [[div class="collapsiblealt"]] and [[/div]]…
Demo6
Important
Cannot be used within [[iftags]].
Cannot be used within [[collapsible]].
Skipping and closing odd numbers causes clutching.
Thanks to tsangk for this great snippet: conditional-blocks
text above inserted with:
[[include :snippets:if START |unique=1|type=equal|var1=%%name%%|var2=conditional-blocks]]
**##red|Thanks to tsangk for this great snippet:##** [[[code:conditional-blocks]]]
[[include :snippets:if END]]
Other snippets posted by RTa_sub
Fake tags with links - 06 Jan 2021 16:07
Rate this solution
If you think this solution is useful — rate it up!
I am unsure if I simply misunderstood, but using the code you displayed first:
Completely bugs when on a page that that has the [[Module Rate]] Module.
It disables the module and then shows a bunch of CSS code on the page.
This could be a folly of my own. It wouldn't be the first time, but perhaps it's worth investigating.
"But as for me and my house, we shall serve the Lord."
Quite good, thank you
[[include :snippets:colalt |oddtop=[|show=+ open|hide=▽ close]]可
折叠的 s hideLocation=“both” 可以复制。
此外,我们可以在顶部和底部显示单独的链接文本。
[[包括:片段:colalt |oddend=[|hide=△close]]
WOW ! I needed time to understand …
Great solution and well done!
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?
Thank you!
I will continue to work hard to create good syntax like this.
+SHOW
-HIDE
{$content-1}
-HIDE
{$content-2}
+SHOW