Template:Preview Only Infobox
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 this page. If you would like to add this feature to a template, follow the stepw below.
Step 1: Create a new sub-page of the template in question. As our example: Template:Used In/Help
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 parameters, so on and so forth.
Unfortunately the <pre></pre> tags cannot be displayed correctly due to the nature of how they work. When copy and pasting this section, manually close out the second </pre> tag for both the "boilerplate" and "help" sections.
<includeonly>{{#switch:{{lc:{{{1|}}}}}<!-- -->|nc|no categories = <!-- -->|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|}}}}}<!-- -->|#default = {{Preview Only Infobox|{{Preview Only Infobox/Default}}}}}} </includeonly>
Step 3: Add the following code to the top of the template page in question. To continue our example, this would be on page Template:Used In.
<includeonly>{{Used In/Help|{{{1}}}}}</includeonly>
Step 4: 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 the code {{Template Name/Documentation}}. If this step isn't completed, the template command "fd" sadly won't work.
Step 5: Test that it works! The following commands will appear when you type the code {{Template Name|}} on any page.
- {{Template Name|bp: displays a boilerplate of this template.
- {{Template Name|command: dislays this list of available commands.
- {{Template Name|fd: provides the template's full documentation.
- {{Template Name|help: displays parameter help.
- {{Template Name|list: generates a list of all templates that have preview window assistance.
- {{Template Name|nd: removes this documentation.