Template:Howto test: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
-->{{#if:{{{file|}}}|<div class= | -->{{#if:{{{file|}}}|<div class='editor_steps_box_wrapper'>}} | ||
<div class= | <div class='editor_steps_box'> | ||
<div class= | <div class='editor_steps_header'> | ||
<div class= | <div class='editor_steps_title'><span>'''{{{preamble|{{#if:{{{title|}}}|How to|{{PAGENAME}}}}}}}{{#if:{{{title|}}}| {{{title|}}}|}}:'''</span></div><!-- | ||
-->{{#if:{{{video|}}}|<div class='howto_video'><span class='video_text'>Watch the video: </span>[[File:YoutubeLogo1.jpg|link={{{video|}}}|frameless|right|75px]]</div>|}}<!-- | -->{{#if:{{{video|}}}|<div class='howto_video'><span class='video_text'>Watch the video: </span>[[File:YoutubeLogo1.jpg|link={{{video|}}}|frameless|right|75px]]</div>|}}<!-- | ||
--></div><!-- | --></div><!-- | ||
--><div class= | --><div class='editor_steps_content'><!-- | ||
-->{{#if:{{{1|}}}|{{{form|:#}}} {{{1}}}}}<!-- | -->{{#if:{{{1|}}}|{{{form|:#}}} {{{1}}}}}<!-- | ||
-->{{#if:{{{2|}}}|{{{form|:#}}} {{{2}}}}}<!-- | -->{{#if:{{{2|}}}|{{{form|:#}}} {{{2}}}}}<!-- | ||
Line 29: | Line 30: | ||
--></div><!-- | --></div><!-- | ||
--></div><!-- | --></div><!-- | ||
-->{{#if:{{{file|}}}|<div class= | -->{{#if:{{{file|}}}|<div class='editor_steps_image'>{{{file|}}}</div></div>}}<!-- | ||
--></includeonly><noinclude> | --></includeonly><noinclude> | ||
If more are needed, | If more are needed, add:<br> | ||
<nowiki>{{#if:{{{ | <nowiki>-->{{#if:{{{20|}}}|{{{form|:#}}} {{{20}}}}}<!--</nowiki> | ||
Example: | Example: | ||
Line 70: | Line 71: | ||
}} | }} | ||
The template can be generated using javascript by executing the following function in javascript ((deprecated, needs to be updated): | The template can be generated using javascript by executing the following function in javascript ((deprecated, needs to be updated): | ||
<pre> | <pre> | ||
var steps=20; | var steps=20; | ||
var string="{{#if:{{{file | var string="<!--"; | ||
string=string+"\n"+ "-->{{#if:{{{file|}}}|<div class='editor_steps_box_wrapper'>}}"; | |||
string=string+"\n"+ "<div class='editor_steps_box'>"; | |||
string=string+"\n"+ "<div class='editor_steps_header'>"; | |||
string=string+"\n"+ "<div class='editor_steps_title'><span>'''{{{preamble|{{#if:{{{title|}}}|How to|{{PAGENAME}}}}}}}{{#if:{{{title|}}}|&nbsp;{{{title|}}}|}}:'''</span></div><!--"; | |||
string=string+"\n"+ "-->{{#if:{{{video|}}}|<div class='howto_video'><span class='video_text'>Watch the video:&nbsp;</span>[[File:YoutubeLogo1.jpg|link={{{video|}}}|frameless|right|75px]]</div>|}}<!--"; | |||
string=string+"\n"+ "--></div><!--"; | |||
string=string+"\n"+ "--><div class='editor_steps_content'><!--"; | |||
string=string+"\n"; | |||
for(i=1;i<=steps;i++) {; | for(i=1;i<=steps;i++) {; | ||
string=string+"\n"+"-->{{#if:{{{"+i+"|}}}|{{{form|:#}}} {{{"+i+"}}}}}<!--"; | |||
} | } | ||
string=string+"\n</div>{{#if:{{{file | string=string+"\n"+ "--></div><!--"; | ||
string=string+"\n"+ "--></div><!--"; | |||
string=string+"\n"+ "-->{{#if:{{{file|}}}|<div class='editor_steps_image'>{{{file|}}}</div></div>}}<!--"; | |||
string=string+"\n"+ "-->"; | |||
console.log(string); | |||
</pre> | </pre> | ||
</noinclude> | </noinclude> |
Latest revision as of 07:46, 21 November 2023
If more are needed, add:
-->{{#if:{{{20|}}}|{{{form|:#}}} {{{20}}}}}<!--
Example:
Howto test:
- First include the template.
- Then write instructions.
- The title will automatically be the page name.
How to add a custom title:
- First include the template.
- Then add a "title" parameter, which will be prefixed with "How to".
- Finally, write instructions.
Setting up other parameters:
- Include the template.
- Use a "preamble" parameter, which will replace the default "How to".
- Use a "title" parameter, which will be prefixed with the entered prefix.
- Use a "form" parameter to dictate the listing prefix (":#" is default, "::*" for indented unordered list.
- Use a "howtoblock" to:
Add multiline instructions
Use an "image" for those instructions. - Finally, review the result.
The template can be generated using javascript by executing the following function in javascript ((deprecated, needs to be updated):
var steps=20; var string="<!--"; string=string+"\n"+ "-->{{#if:{{{file|}}}|<div class='editor_steps_box_wrapper'>}}"; string=string+"\n"+ "<div class='editor_steps_box'>"; string=string+"\n"+ "<div class='editor_steps_header'>"; string=string+"\n"+ "<div class='editor_steps_title'><span>'''{{{preamble|{{#if:{{{title|}}}|How to|{{PAGENAME}}}}}}}{{#if:{{{title|}}}| {{{title|}}}|}}:'''</span></div><!--"; string=string+"\n"+ "-->{{#if:{{{video|}}}|<div class='howto_video'><span class='video_text'>Watch the video: </span>[[File:YoutubeLogo1.jpg|link={{{video|}}}|frameless|right|75px]]</div>|}}<!--"; string=string+"\n"+ "--></div><!--"; string=string+"\n"+ "--><div class='editor_steps_content'><!--"; string=string+"\n"; for(i=1;i<=steps;i++) {; string=string+"\n"+"-->{{#if:{{{"+i+"|}}}|{{{form|:#}}} {{{"+i+"}}}}}<!--"; } string=string+"\n"+ "--></div><!--"; string=string+"\n"+ "--></div><!--"; string=string+"\n"+ "-->{{#if:{{{file|}}}|<div class='editor_steps_image'>{{{file|}}}</div></div>}}<!--"; string=string+"\n"+ "-->"; console.log(string);