Difference between revisions of "Template:CustomToggleButton"

From Pathfinder Wiki
(remove the possibility to close/open multiple boxes with one button (it's a test to minimize the amount of #forargs used on the wiki) that feature isn't used so I remove it)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
 +
<translate><!--T:1-->
 
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.
 
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:<br>
 
For example like that:<br>
<div class="toccolours"><nowiki>
+
<div class="toccolours">
{{CustomToggleButton|text=Show/Hide text|name=example-box}}</nowiki><br><nowiki>
+
<p>
<div class="mw-collapsible" id="mw-customcollapsible-example-box"></nowiki><br>
+
::<nowiki>{{CustomToggleButton|text=Show/Hide text|name=example-box}}</nowiki><br>
::<nowiki>This text will be shown/hidden by a press of the button.</nowiki><br><nowiki>
+
::<nowiki><div class="mw-collapsible" id="mw-customcollapsible-example-box"></nowiki><br>
</div></nowiki><br>
+
::::<nowiki>This text will be shown/hidden by a press of the button.</nowiki>
 +
::<nowiki></div></nowiki></p>
 
</div>
 
</div>
 
+
{{CustomToggleButton|text={{#switch:{{SUBPAGENAME}}|es=Mostrar/ocultar|fr=Afficher/Masquer|Show/Hide}}|name=1}}
{{CustomToggleButton|text=Einklappen|name=example-box}}
+
<div class="mw-collapsible" id="mw-customcollapsible-1">
<div class="mw-collapsible" id="mw-customcollapsible-example-box">
 
 
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>
 +
</translate>
 
</noinclude>
 
</noinclude>
  
<includeonly>
+
<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>
<span class="mw-customtoggle-{{{name}}}">
 
[
 
<span style="text-decoration: underline; color: blue; cursor: pointer;">
 
{{{text|{{#switch:{{SUBPAGENAME}}|es=Mostrar/ocultar|fr= Afficher/Masquer|Show/Hide}}}}}
 
</span>
 
]
 
</span>
 
</includeonly>
 

Latest revision as of 16:48, 17 March 2021

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>


[Show/Hide]

This text will be shown/hidden by a press of the button.