Template:Howto: Difference between revisions

From Tygron Preview Support Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:
<pre>
<pre>
var steps=20;
var steps=20;
var string="{{#if:{{{file|}}}|<div class=\"editor_steps_box_wrapper\">}}<div class=\"editor_steps_box\"><p><span class=\"editor_steps_title\">'''How to{{#if:{{{title|}}}|&nbsp;{{{title}}}}}:'''</span></p>";
var string="{{#if:{{{file|}}}|<div class=\"editor_steps_box_wrapper\">}}<div class=\"editor_steps_box\"><p><span class=\"editor_steps_title\">'''{{{prelude|How to}}}{{#if:{{{title|}}}|&nbsp;{{{title}}}}}:'''</span></p>";
for(i=1;i<=steps;i++) {;
for(i=1;i<=steps;i++) {;
  string+="{{#if:{{{"+i+"|}}}|:# {{{"+i+"}}}}}";
  string+="{{#if:{{{"+i+"|}}}|{{{form}}} {{{"+i+"}}}}}";
}
}
string=string+"</div>{{#if:{{{file|}}}|<div class=\"editor_steps_image\">{{{file}}}</div></div>}}";
string=string+"</div>{{#if:{{{file|}}}|<div class=\"editor_steps_image\">{{{file}}}</div></div>}}";
</pre>
</pre>
</noinclude>
</noinclude>

Revision as of 11:01, 27 August 2014

How to:

If more are needed, append:
{{#if:{{{8|}}}|:# {{{8}}}}}

The template can be generated using javascript by executing the following function in javascript:

var steps=20;
var string="{{#if:{{{file|}}}|<div class=\"editor_steps_box_wrapper\">}}<div class=\"editor_steps_box\"><p><span class=\"editor_steps_title\">'''{{{prelude|How to}}}{{#if:{{{title|}}}| {{{title}}}}}:'''</span></p>";
for(i=1;i<=steps;i++) {;
 string+="{{#if:{{{"+i+"|}}}|{{{form}}} {{{"+i+"}}}}}";
}
string=string+"</div>{{#if:{{{file|}}}|<div class=\"editor_steps_image\">{{{file}}}</div></div>}}";