Template:Dropdown: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 2: Line 2:
{{#if: {{{Page title|}}}|{{Page header|Page title={{{Page title|}}}|}}|<nowiki></nowiki>}}
{{#if: {{{Page title|}}}|{{Page header|Page 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|}}}|<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|}}}|<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|}}}|<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. -->
{{#if: {{{Dropdown title|}}}|{{#if:{{{Previous dropdown title|}}}
{{#if: {{{Dropdown title|}}}|{{#if:{{{Previous dropdown title|}}}
|<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>
Line 26: Line 27:
;Page title=|
;Page title=|
:''Page title'' will change the page title from the URL to whatever is set as ''Page title''.  For example, <nowiki>{{Dropdown|Page title=Wales Research Page|}}</nowiki>
:''Page title'' will change the page title from the URL to whatever is set as ''Page title''.  For example, <nowiki>{{Dropdown|Page title=Wales Research Page|}}</nowiki>
;Section title=| and Section title size=|
;Section title=|  
;Section title size=|
:''Section title'' will output the text that you enter, and will use ''Section title size'' as the text size value. ''Section title size'' must be a number from 1-5, since it will use this number to generate the size of the text using <nowiki><h1>, <h2>, <h3>, <h4>, <h5> and <h6></nowiki>.  Following are the current text sizes for numberes 1-6:
:''Section title'' will output the text that you enter, and will use ''Section title size'' as the text size value. ''Section title size'' must be a number from 1-5, since it will use this number to generate the size of the text using <nowiki><h1>, <h2>, <h3>, <h4>, <h5> and <h6></nowiki>.  Following are the current text sizes for numberes 1-6:
:<div style="width:60%;">
:<div style="width:60%;">
Line 37: Line 39:
:</div>
:</div>
;Section text=|
;Section text=|
:At the moment, ''Section text'' and ''Page text'' are identical, placing text at the top of the current working area.  This may change in the future with different sizes based on which text is being defined.  <br>
;Section text size=|
:''Section text'' will output the text that you enter and will use ''Section text size'' as the text size value. ''Section text size'' must be a number from 1-5...please refer to ''Section title size=|'' above, for a detailed explanation of font sizes.  At the moment, ''Section text'' and ''Page text'' are identical, placing text at the top of the current working area.  This may change in the future with different sizes based on which text is being defined.  <br>
:'''example''':  
:'''example''':  
<div style="width:50%">
<div style="width:50%">
Line 48: Line 51:
</div>
</div>
;Page text=|
;Page text=|
:''Page text'' can be as much text as you need in order to explain something.  It will be put above the Dropdown area.  If you need to put a carriage return in the middle of the text, use <nowiki><br></nowiki>.  The text size that will be used will be <nowiki><p></nowiki>
;Page text size=|
:''Page text'' can be as much text as you need in order to explain something.  It will be put above the Dropdown area.  If you wish to put a carriage return in the middle of the text, use <nowiki><br></nowiki>.  The text size that will be used will be <nowiki><p></nowiki>, unless ''Page text size'' is specified.  ''Page text size'' must be a number from 1-5...please refer to ''Section title size=|'' above, for a detailed explanation of font sizes.


;Begin text=|
;Begin text=|
:''Begin text'' will place text immediately after the dropdown keyword, and will be visible after the user has selected the keyword to open up the dropdown area.   
;Begin text size=|
:''Begin text'' will place text immediately after the dropdown keyword, and will be visible after the user has selected the keyword to open up the dropdown area.  If no ''Begin text size'' is used, <nowiki><p></nowiki> will be used to define the text.  Please refer to ''Section title size=|'' above, for a detailed explanation of font sizes.
;Page image=|
;Page image=|
:''Page image'' will place an image on the page, exactly as you specify the image.  In other words, use wiki code to define the ''Page image''. <br>  
:''Page image'' will place an image on the page, exactly as you specify the image.  In other words, use wiki code to define the ''Page image''. <br>  
Line 72: Line 77:
{{Dropdown end}}</nowiki>
{{Dropdown end}}</nowiki>
</div>
</div>
;Dropdown text style=|
:''Dropdown text style'' defines how the text for the ''Dropdown title'' will look.  If you do not use this parameter, <nowiki><p></nowiki> will be used.  If you wish to have the dropdown look like a link, you can use the following.
<br>
:'''example''':
<div style="width:60%">
<nowiki>
{{Dropdown|
  Dropdown title=Birth|
  Dropdown text style=font-size:small !important; color:#0B0BEC !important; display:inline-block; font-weight:bold;|}}
{{Dropdown end}}</nowiki>
</div>
;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 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>
Line 94: Line 112:
{{Dropdown end}}</nowiki>
{{Dropdown end}}</nowiki>
</div>
</div>
;Dropdown text style=|
:''Dropdown text style'' defines how the text for the ''Dropdown title'' will look.  If you do not use this parameter, <nowiki><p></nowiki> will be used.  If you wish to have the dropdown look like a link, you can use the following.
<br>
<br>
:'''example''':
== Troubleshooting ==
<div style="width:60%">
;Text styles not working correctly
:Due to layering of css files in php, sometimes another css file may take higher priority than specific code defined on a page.  If this happens, you may not see the style that you defined, but will see whatever css file code has been defined as a higher priority.  In order to fix this issue, add ''!important'' after each style that you define.  This forces your style to take priority over any other style defined in the css code.
 
:'''example''':  
  <nowiki>
  <nowiki>
{{Dropdown|
{{Dropdown|
   Dropdown title=Birth|
   Dropdown title=Section 1|
   Dropdown text style=font-size:small; color:#0B0BEC; display:inline-block; font-weight:bold;|}}
   Dropdown text style=font-size:small !important; color:#0B0BEC !important; text-decoration:underline !important; display:inline-block; font-weight:bold;|
{{Dropdown end}}</nowiki>
}}
</div>
</nowiki>


== Troubleshooting ==
;Dropdown areas not working
If you are unable to get the dropdown areas to work correctly, there are several things that you should verify.
If you are unable to get the dropdown areas to work correctly, there are several things that you should verify.
# Verify that all parameters passed into the Dropdown template are spelled correctly, with correct lowercase and uppercase letters.
# Verify that all parameters passed into the Dropdown template are spelled correctly, with correct lowercase and uppercase letters.
Line 198: Line 217:


</nowiki>
</nowiki>


[[Category:templates|{{PAGENAME}}]]
[[Category:templates|{{PAGENAME}}]]
</noinclude>
</noinclude>
2,664

edits