Template:Dropdown: Difference between revisions

correct typo in sample code
No edit summary
(correct typo in sample code)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  __NOEDITSECTION__
  __NOEDITSECTION__
{{#if: {{{Page title|}}}|{{Page header|Page title={{{Page title|}}}|}}|<nowiki></nowiki>}}
{{#if: {{{Page title|}}}|{{New page title|New title={{{Page title|}}}|}}|<nowiki></nowiki>}}
{{#if: {{{Section title|}}}|{{#if: {{{Section title size|}}}|<h{{{Section title size}}}>{{{Section title}}}</h{{{Section title size}}}>|<p>{{{Section title}}}</p>}}|<nowiki></nowiki>}}
{{#if: {{{Section title|}}}|{{#if: {{{Section title size|}}}|<h{{{Section title size}}}>{{{Section title}}}</h{{{Section title size}}}>|<p>{{{Section title}}}</p>}}|<nowiki></nowiki>}}
{{#if: {{{Page text|}}}|{{#if: {{{Page text size|}}}|<h{{{Page text size}}}>{{{Page text}}}</h{{{Page text size}}}>|<p>{{{Page text|}}}</p>|<nowiki></nowiki>}}
{{#if: {{{Page text|}}}|{{#if: {{{Page text size|}}}|<h{{{Page text size}}}>{{{Page text}}}</h{{{Page text size}}}>|<p>{{{Page text|}}}</p>}}|<nowiki></nowiki>}}
{{#if: {{{Section text|}}}|{{#if: {{{Section text size|}}}|<h{{{Section text size}}}>{{{Section text}}}</h{{{Section text size}}}>|<p>{{{Section text|}}}</p>|<nowiki></nowiki>}}
{{#if: {{{Section text|}}}|{{#if: {{{Section text size|}}}|<h{{{Section text size}}}>{{{Section text}}}</h{{{Section text size}}}>|<p>{{{Section text|}}}</p>}}|<nowiki></nowiki>}}
<!--{{#if: {{{Begin text|}}}|{{#if: {{{Begin text size|}}}|<h{{{Begin text size}}}>{{{Begin text}}}</h{{{Begin text size}}}>|<p>{{{Begin text|}}}</p>|<nowiki></nowiki>}}-->
<!--{{#if: {{{Begin text|}}}|{{#if: {{{Begin text size|}}}|<h{{{Begin text size}}}>{{{Begin text}}}</h{{{Begin text size}}}>|<p>{{{Begin text|}}}</p>}}|<nowiki></nowiki>}}-->
{{#if: {{{Page image|}}}|{{{Page image|}}}|<nowiki></nowiki>}}
{{#if: {{{Page image|}}}|{{{Page image|}}}|<nowiki></nowiki>}}
<!-- The following code is designed to eliminate duplicate naming of dropdown headings, since duplicate headings means that when one heading is clicked, all dropdown headings with the same title will open.  An example would be having a title like '1800-1900' under a dropdown of Birth, Marriage and Death.  When '1800-1900' is selected, all three areas will open up, even though they may still be hidden in the different dropdown areas.  In order to fix this, the 'Previous dropdown title', such as 'Birth', 'Marriage', or 'Death', should be added to the Dropdown call of each '1800-1900' section in order to avoid this issue. -->
<!-- The following code is designed to eliminate duplicate naming of dropdown headings, since duplicate headings means that when one heading is clicked, all dropdown headings with the same title will open.  An example would be having a title like '1800-1900' under a dropdown of Birth, Marriage and Death.  When '1800-1900' is selected, all three areas will open up, even though they may still be hidden in the different dropdown areas.  In order to fix this, the 'Previous dropdown title', such as 'Birth', 'Marriage', or 'Death', should be added to the Dropdown call of each '1800-1900' section in order to avoid this issue. -->
Line 10: Line 10:
|<span class="mw-customtoggle-{{#replace:{{{Previous dropdown title|}}}| |_}}_{{#replace:{{{Dropdown title|}}}| |_}}" style="{{{Dropdown text style|}}}">{{{Dropdown title|}}}</span>
|<span class="mw-customtoggle-{{#replace:{{{Previous dropdown title|}}}| |_}}_{{#replace:{{{Dropdown title|}}}| |_}}" style="{{{Dropdown text style|}}}">{{{Dropdown title|}}}</span>
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-{{#replace:{{{Previous dropdown title|}}}| |_}}_{{#replace:{{{Dropdown title|}}}| |_}}" style="height:auto; width=50%;">
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-{{#replace:{{{Previous dropdown title|}}}| |_}}_{{#replace:{{{Dropdown title|}}}| |_}}" style="height:auto; width=50%;">
<span class="mw-customtoggle-{{#replace:{{{Previous dropdown title|}}}| |_}}_{{#replace:{{{Dropdown title|}}}| |_}}" style="color:#0B0BEC;font-size:x-small;float:left;">[hide]</span>
<span class="mw-customtoggle-{{#replace:{{{Previous dropdown title|}}}| |_}}_{{#replace:{{{Dropdown title|}}}| |_}}" style="color:#0B0BEC !important;font-size:small !important;float:left !important;">[hide]</span>
|<span class="mw-customtoggle-{{#replace:{{{Dropdown title|}}}| |_}}" style="{{{Dropdown text style|}}}">{{{Dropdown title|}}}</span>
|<span class="mw-customtoggle-{{#replace:{{{Dropdown title|}}}| |_}}" style="{{{Dropdown text style|}}}">{{{Dropdown title|}}}</span>
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-{{#replace:{{{Dropdown title|}}}| |_}}" style="height:auto;">
<div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-{{#replace:{{{Dropdown title|}}}| |_}}" style="height:auto;">
<p><span class="mw-customtoggle-{{#replace:{{{Dropdown title|}}}| |_}}" style="color:#0B0BEC;font-size:small;float:right;">[hide]</span></p>|}}<br/>
<p><span class="mw-customtoggle-{{#replace:{{{Dropdown title|}}}| |_}}" style="color:#0B0BEC !important;font-size:small !important;float:left;">[hide]</span></p>|}}<br/>
|<nowiki></nowiki>}}
|<nowiki></nowiki>}}
{{#if: {{{Begin text|}}}|<p>{{{Begin text|}}}</p>|<nowiki></nowiki>}}
{{#if: {{{Begin text|}}}|{{#if: {{{Begin text size|}}}|<h{{{Begin text size}}}>{{{Begin text}}}</h{{{Begin text size}}}>|<p>{{{Begin text|}}}</p>}}|<nowiki></nowiki>}}
<noinclude>
<noinclude>


Line 91: Line 91:


;Previous dropdown title=|
;Previous dropdown title=|
:''Previous dropdown title''' is used when you are created dropdown areas inside of dropdown areas.  For example, if you create 3 top-level options of Birth, Marriage and Death, and then create dropdown areas within the 3 different areas.  In the code that creates the dropdown area, a proper name is assigned to the area, so when the keyword is selected, the wiki knows exactly which area is to be opened or closed.  These areas are named based on the title (or keyword) given to that particular dropdown areas, however, sometimes there are duplicate keywords that are used on the same page.  (Example: Under Birth, Marriage and Death, you may want to create dates like '1850 to 1900', as keywords under all three of the main options.  In this case, when you create the 2nd level dropdown using these duplicate keywords, you must also define the keyword that was used as the top-level option.  <br>
:''Previous dropdown title'' is used when you create dropdown areas inside of dropdown areas.  For example, when you create 3 top-level options such as Birth, Marriage and Death, and then create dropdown areas within each of those 3 top-level options, you will need to use the this template.  In the code that creates the dropdown area, a proper name is assigned to the area, so when the keyword is selected, the wiki knows exactly which area is to be opened or closed.  These areas are named based on the title (or keyword) given to that particular dropdown areas, however, sometimes there are duplicate keywords that are used on the same page.  (Example: Under Birth, Marriage and Death, you may want to create dates like '1850 to 1900', as keywords under all three of the main options.  In this case, when you create the 2nd level dropdown using these duplicate keywords, you must also define the keyword that was used as the top-level option.  <br>
:'''example''':  
:'''example''':  
<div style="width:50%">
<div style="width:50%">
Line 193: Line 193:
   Dropdown title=Section 3|
   Dropdown title=Section 3|
   Dropdown text style=font-size:small; color:#0B0BEC; text-decoration:underline; display:inline-block; font-weight:bold;|
   Dropdown text style=font-size:small; color:#0B0BEC; text-decoration:underline; display:inline-block; font-weight:bold;|
   Begin text=This text will only be displayed after the Section 2 has been selected|
   Begin text=This text will only be displayed after the Section 3 has been selected|
}}
}}


53,890

edits