Template:InlineSpoiler: Difference between revisions

From Red Faction Wiki
(Created.)
 
(Documentation added.)
 
Line 1: Line 1:
<span style="border:1px solid #000;background:#FFF;-moz-border-radius:50%;padding:0 .5em;font-variant:small-caps" title="">spoiler <span style="border-left:1px solid #000;background:#000;color:#000;padding:0 .5em;font-variant:normal">{{{1}}}</span> end<span style="font-size:0"> of spoiler</span></span><noinclude>
<span style="border:1px solid #000;background:#FFF;-moz-border-radius:50%;padding:0 .5em;font-variant:small-caps" title="">spoiler <span style="border-left:1px solid #000;background:#000;color:#000;padding:0 .5em;font-variant:normal">{{{1}}}</span> end<span style="font-size:0"> of spoiler</span></span><noinclude>
Inline, accessible spoilers. Much better than the JS &lt;spoiler> version, which isn't very well coded anyway.</noinclude>
 
Inline, accessible spoilers. Much better than the JS &lt;spoiler> version, which isn't very well coded anyway.
 
Syntax:
<code><nowiki>{{InlineSpoiler|1=Your text}}</nowiki></code>
{{InlineSpoiler|1=Your text}}
 
A few things to note.
*Some symbols used in wikimarkup must be converted to HTML entities. In particular, vertical pipes must be converted to <code><nowiki>&amp;#124;</nowiki></code>.
**If you wish to use a vertical pipe as part of some valid wikimarkup present in the input (e.x. a table), you'll need to use the [[Template:!|!]] template. If that template does not exist on this wiki, you can [[Wikipedia:Template:!|find it on Wikipedia]]. You would use the template in place of the vertical pipe (replacing <code><nowiki>|</nowiki></code> with <code><nowiki>{{!}}</nowiki></code>).
***There's no reason to use tables ''inside'' of this template. For entire paragraphs, headers, tables, or other similar "blocks", ''please'' use the default &lt;SPOILER> tags.
*"Magic words" such as <code><nowiki>{{PAGENAME}}</nowiki></code> should function just fine.
*Nested templates should also work, though based on the other templates' code, the results may be... unpredictable.
*The <code><nowiki>1=</nowiki></code> can be omitted, but ''only'' if no equal signs are present in the input.</noinclude>

Latest revision as of 19:02, 25 July 2009

spoiler {{{1}}} end of spoiler

Inline, accessible spoilers. Much better than the JS <spoiler> version, which isn't very well coded anyway.

Syntax: {{InlineSpoiler|1=Your text}} spoiler Your text end of spoiler

A few things to note.

  • Some symbols used in wikimarkup must be converted to HTML entities. In particular, vertical pipes must be converted to &#124;.
    • If you wish to use a vertical pipe as part of some valid wikimarkup present in the input (e.x. a table), you'll need to use the ! template. If that template does not exist on this wiki, you can find it on Wikipedia. You would use the template in place of the vertical pipe (replacing | with {{!}}).
      • There's no reason to use tables inside of this template. For entire paragraphs, headers, tables, or other similar "blocks", please use the default <SPOILER> tags.
  • "Magic words" such as {{PAGENAME}} should function just fine.
  • Nested templates should also work, though based on the other templates' code, the results may be... unpredictable.
  • The 1= can be omitted, but only if no equal signs are present in the input.