|
|
Line 1: |
Line 1: |
| <onlyinclude><includeonly>{{#switch:{{{disable|}}}|no documentation|no doc|ncnd|ndnc|nd=|#default={{#if:{{REVISIONID}}||<div style="border: 4px #AA0000 solid;"><div style="margin: 4px; padding: 4px; text-align: center; font-weight: bold; color: #AA0000; font-size: 1.6em;">This Documentation is only visible in preview mode!</div>{{{1|}}}</div>}}}}</includeonly></onlyinclude> | | <onlyinclude><includeonly>{{#switch:{{{disable|}}}|no documentation|no doc|ncnd|ndnc|nd=|#default={{#if:{{REVISIONID}}||<div style="border: 4px #AA0000 solid;"><div style="margin: 4px; padding: 4px; text-align: center; font-weight: bold; color: #AA0000; font-size: 1.6em;">This Documentation is only visible in preview mode!</div>{{{1|}}}</div>}}}}</includeonly></onlyinclude> |
| ==Usage==
| |
| This template was originally designed to provide help and support to editors when viewing a page in "preview mode". It's since been expanded upon and now provides several different versions of preview mode assistance that will hopefully help editors even further. To see a full list of existing template with this feature, please see [[:Template:Preview Only Infobox/List|this page]]. If you would like to add this feature to a template, follow the stepw below.
| |
| <br>
| |
|
| |
| '''Step 1:''' Create a new sub-page of the template in question. As our example: [[:Template:Used In/Help]]<br><br>
| |
| '''Step 2:''' Paste the below code onto the page. Ensure to tailor the code to your template ie. replace "Template Name" with the required template name, include the associated parameters, etc.<br><br>
| |
| Unfortunately the <nowiki><pre></pre></nowiki> tags cannot be displayed correctly due to the nature of how they work. When copy and pasting this section, manually close out the second <nowiki></pre></nowiki> tag for both the "boilerplate" and "help" sections.
| |
| <pre><includeonly>{{#switch:{{lc:{{{1|}}}}}<!--
| |
|
| |
| -->|bp|boilerplate =
| |
| {{Preview Only Infobox|These parameters are the ones most commmonly used for the Horizon server.
| |
| <pre>{{Template Name
| |
| | = add as many parameters as required
| |
| }}<pre>|disable={{{1|}}}}}<!--
| |
|
| |
| -->|help =
| |
| {{Preview Only Infobox|
| |
| <pre>{{Template Name
| |
| | parameter = {short explanation on how each one should be filled out}
| |
| }}<pre>|disable={{{1|}}}}}<!--
| |
|
| |
| -->|fd = {{Preview Only Infobox|{{Template:Name/Documentation}}
| |
| |disable={{{1|}}}}}<!--
| |
|
| |
| -->|nd|no documentation = <!--
| |
|
| |
| -->|list = {{Preview Only Infobox|{{Preview Only Infobox/List}}
| |
| |disable={{{1|}}}}}<!--
| |
|
| |
| -->|command|commands = {{Preview Only Infobox|{{Preview Only Infobox/Default}}}}<!--
| |
|
| |
| -->|#default = {{Preview Only Infobox|{{Preview Only Infobox/Default}}}}}}
| |
| </includeonly></pre><br>
| |
|
| |
| '''Step 3:''' Decide whether you would prefer the preview only infobox to display as default or when the editor "turns it on". The copied text from step 2 is set to display as default. To change this, change the <nowiki>#default</nowiki> line to the following:
| |
| <pre>-->|#default = }}</pre><br>
| |
| '''Step 4:''' Add the following code to the top of the original template page in question. To continue our example, this would be on page [[:Template:Used In]].
| |
| <pre><includeonly><onlyinclude>{{Item Statistics/Help|{{{1}}}}}</onlyinclude></includeonly></pre>
| |
|
| |
| If an "<nowiki><includeonly></nowiki>" and/or "<nowiki><onlyinclude></nowiki>" are already present on the template page, simply slot this code in above everything, on the very first line.<br><br>
| |
|
| |
| '''Step 5:''' If your template page has documentation, it needs moving to its own sub-page. In our example, this would be moved to [[:Template:Used In/Documentation]]. This documentation then needs transcluding back onto the template page. To do this use this following code and if this step isn't completed, the command "fd" sadly won't work.
| |
| <pre>{{Template Name/Documentation}}</pre><br>
| |
|
| |
| '''Step 6:''' Add the template to the list of templates that have preview window infoboxes on [[Template:Preview Only Infobox/List|this page]].<br>
| |
|
| |
| '''Step 7:''' Test that it works! The following commands will appear when you type the code <nowiki>{{Template Name|}}</nowiki> on any page.
| |
| {{#section:Template:Preview Only Infobox/Default|commands}}<!--
| |
|
| |
| preserving the orignially documentation and some hopefully unneeded code.
| |
|
| |
| *'''First unnamed Parameter''' (optional): You can set the first unnamed parameter to:
| |
| ** ''nc'' (no category) to prevent automatic categorization (e.g. for example pages)
| |
| ** ''nd'' (no documentation) to suppress the preview documentation (helpful in the editing process)
| |
| ** ''ncnd'' or ''ndnc'' prevents both, categorization of the page as well as showing a documentation in preview mode. Again, most useful for example pages.
| |
| ** ''bp'' (boilerplate) to have the preview documentation without comments so you can just copy it to the page (helpful for creating new pages to just start with {{fontaccent|<nowiki>{{</nowiki>{{PAGENAME}}<nowiki>|bp}}</nowiki>}} and copy the boilerplate from the preview only)
| |
| -->
| |
|
| |
|
| |
| <!--This Template will provide an infobox that is only visible in preview mode. Main usage is template documentation for very common templates with many options.
| |
|
| |
| ''Note: The preview infobox can be disabled with the parameter "disable" e.g. when giving examples on other template pages. Disable can be set to anything, the infobox will only show if disable is empty.''
| |
|
| |
| Example:
| |
|
| |
| <pre>{{Preview Only Infobox|<pre>
| |
| {{Mission Header
| |
| | Mission Name = {Name of the Mission}
| |
| | Expansion = {Series of the Missions}
| |
| | Start = {NPC name that starts the quest}
| |
| | Start Location = {Location template}
| |
| | Description = {Ingame Mission Description}
| |
| | Level = {Required Level to complete the Mission}
| |
| | Requirements = {Requirements to ACCEPT the Mission}
| |
| | Items Needed = {Items Needed to COMPLETE the Mission}
| |
| | Repeatable = {yes/no}
| |
| | Title = {Title(s) obtained thoughout the mission
| |
| | Rewards = {Rewards obtained for COMPLETING the Mission}
| |
| | Previous = {previous mission: link{{!}}name}
| |
| | Next = {next mission: link{{!}}name}
| |
| }}</ pre>
| |
| </pre>
| |
|
| |
| {{Preview Only Infobox|
| |
| <pre>
| |
| {{Mission Header
| |
| | Mission Name = {Name of the Mission}
| |
| | Expansion = {Series of the Missions}
| |
| | Start = {NPC name that starts the quest}
| |
| | Start Location = {Location template}
| |
| | Description = {Ingame Mission Description}
| |
| | Level = {Required Level to complete the Mission}
| |
| | Requirements = {Requirements to ACCEPT the Mission}
| |
| | Items Needed = {Items Needed to COMPLETE the Mission}
| |
| | Repeatable = {yes/no}
| |
| | Title = {Title(s) obtained thoughout the mission
| |
| | Rewards = {Rewards obtained for COMPLETING the Mission}
| |
| | Previous = {previous mission: link{{!}}name}
| |
| | Next = {next mission: link{{!}}name}
| |
| }}</pre>
| |
| }}-->
| |