Difference between revisions of "Template:CustomToggleButton"
From Pathfinder Wiki
DesignerThan (talk | contribs) |
DesignerThan (talk | contribs) |
||
Line 10: | Line 10: | ||
::<nowiki></div></nowiki></p> | ::<nowiki></div></nowiki></p> | ||
</div> | </div> | ||
− | {{CustomToggleButton|text={{#switch:{{SUBPAGENAME}}|es=Mostrar/ocultar|fr=Afficher/Masquer|Show/Hide}}| | + | {{CustomToggleButton|text={{#switch:{{SUBPAGENAME}}|es=Mostrar/ocultar|fr=Afficher/Masquer|Show/Hide}}|name=1}} |
<div class="mw-collapsible" id="mw-customcollapsible-1"> | <div class="mw-collapsible" id="mw-customcollapsible-1"> | ||
This text will be shown/hidden by a press of the button. | This text will be shown/hidden by a press of the button. | ||
</div> | </div> | ||
− | + | <!-- for this stuff I would need the newest parser functions the needed one is #forargs --> | |
+ | <!-- {{#forargs: name | key | value | <nowiki /> {{#var: value}}}} --> | ||
+ | <!-- | ||
It is also possible to close multiple boxes with one button like that:<br> | It is also possible to close multiple boxes with one button like that:<br> | ||
<div class="toccolours"> | <div class="toccolours"> | ||
Line 47: | Line 49: | ||
<b>Box 4: </b>This text will be shown/hidden by a press of the button. | <b>Box 4: </b>This text will be shown/hidden by a press of the button. | ||
</div> | </div> | ||
− | + | --> | |
</translate> | </translate> | ||
</noinclude> | </noinclude> | ||
− | <includeonly><span>[<span class=" | + | <includeonly><span>[<span class="mw-customtoggle-{{{name}}}" style="text-decoration: underline; color: blue; cursor: pointer;">{{{text|{{#switch:{{SUBPAGENAME}}|es=Mostrar/ocultar|fr=Afficher/Masquer|Show/Hide}}}}}</span>]</span></includeonly> |
Revision as of 00:35, 9 November 2020
This template is used to create a custom toggle button for a collapsable box. You need to add the text of the button and a name for the toggle button. This name needs to be used also for the collapsible box in the id-Property.
For example like that:
- {{CustomToggleButton|text=Show/Hide text|name=example-box}}
- <div class="mw-collapsible" id="mw-customcollapsible-example-box">
- This text will be shown/hidden by a press of the button.
- </div>
- {{CustomToggleButton|text=Show/Hide text|name=example-box}}
[Show/Hide]
This text will be shown/hidden by a press of the button.