Template:Eyecatch: Difference between revisions

From AniDB
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
| style="background:black; padding-bottom:2px; padding-left:8px; padding-right:8px; white-space:nowrap;" | <span style="color: white; font-weight: bold;">{{#if: {{{3|}}} | {{{2}}} | {{{1}}}}}</span>
| style="background:black; padding-bottom:2px; padding-left:8px; padding-right:8px; white-space:nowrap;" | <span style="color: white; font-weight: bold;">{{#if: {{{3|}}} | {{{2}}} | {{{1}}}}}</span>
| style="padding:2px 8px; width:100%;" | ''{{#if: {{{3|}}} | {{{3}}} | {{{2}}}}}''  
| style="padding:2px 8px; width:100%;" | ''{{#if: {{{3|}}} | {{{3}}} | {{{2}}}}}''  
|}</includeonly><noinclude>{{{{PAGENAME}}/Documentation}}[[Category:Template]]</noinclude>
|}</includeonly><noinclude>{{{{PAGENAME}}/doc}}[[Category:Template]]</noinclude>

Revision as of 20:52, 5 May 2009

This template creates an eye-catcher bar that can be indented up to 6 times via parameter value, letting the user better customize his "Note"s. The code is backwards compatible, letting the user keep on using the old 2 parameter version as well.

New Subtle one-pixel border added, padding improved, <info> is not word-wrapped.
Light Note There is another "lighter" version of the eyecatcher-bar available by using the eyecatchLight template shown here in this "Light Note" box.

Syntax

The template can have 2 or 3 parameters:

  1. {{eyecatch|<info>|<text>}} - Default mode, no indentation.
  2. {{eyecatch|<#>|<info>|<text>}} - Define indentation via <#> parameter.
       <#> =  Number 0 (min) to 6 (max), defines indentation level.
    <info> =  The info to highlight (not word-wrapped), i.e. Note or Important.
    <text> =  The descriptive text for the info.
Note Only the <#> values 1 to 6 are actually checked, any other values (e.g. 0 or abc) yield no indentation at all, and are treated the same as {{eyecatch|info|text}}!
Note The <info> parameter is intended for short message headers. To improve readability the word-wrapping is turned off!

Examples

{{eyecatch|0|Note|'''No''' indentation, just like the normal <tt>eyecatch</tt>.}}
{{eyecatch|abc|Note|'''No''' indentation, just like the normal <tt>eyecatch</tt>.}}
{{eyecatch||Note|'''No''' indentation, just like the normal <tt>eyecatch</tt>.}}
Note No indentation, just like the normal eyecatch.
{{eyecatch|1|Another note|'''One''' indentation, just like <tt>eyecatch2</tt>.}}
Another note One indentation, just like eyecatch2.
{{eyecatch|2|Important|Level '''two''' indentation!}}
Important Level two indentation!
{{eyecatch|6|Very important|Maximum indentation level of '''six'''! "Very important" is ...}}
Very important Maximum indentation level of six! "Very important" is not word-wrapped.

Test the Code

Should more code testing be required see the Template:Eyecatch/Test Code page.