Template:Font color/doc

From EnigmaGuy Wiki
Revision as of 09:47, 16 August 2015 by Enigmaguy (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

{{#ifeq:doc |doc

    | 

{{#ifeq:show |show

|

        }}{{#if: |
         |   {{#ifexist:Template:Font color
                  | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
                  |
                 }}
        }}
    | 
   }}

Usage

Parameters

Use / description Default
{{{1}}} font color default
{{{2}}} text
link page link
Or
Use / description Default
{{{1}}} font color default
{{{2}}} background color default
{{{3}}} text
link page link


{{{{#if: |subst:}}font color{{#if:<text color> ||<text color>}}{{#if:<background color> ||<background color>}}{{#if:<text> ||<text>}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||}}}}

Examples:

Markup Renders as
{{font color|green|green text}} {{ safesubst:#if: {{ safesubst:#if: yes [[|]] [[|]]
     }}
   }}
{{ safesubst:#if: yes green text [[|green text]]
   }}
green text
 }}

}}

{{font color|blue|do not style text as a link}} {{ safesubst:#if: {{ safesubst:#if: yes [[|]] [[|]]
     }}
   }}
{{ safesubst:#if: yes do not style text as a link [[|do not style text as a link]]
   }}
do not style text as a link
 }}

}}

{{font color|white|black|white with black background}} {{ safesubst:#if: white with black background {{ safesubst:#if: yes white with black background [[|white with black background]]
     }}
white with black background
   }}
{{ safesubst:#if: yes black [[|black]]
   }}
black
 }}

}}

{{font color||yellow|default text in yellow background}} {{ safesubst:#if: default text in yellow background {{ safesubst:#if: yes default text in yellow background [[|default text in yellow background]]
     }}
default text in yellow background
   }}
{{ safesubst:#if: yes yellow [[|yellow]]
   }}
yellow
 }}

}}

The |{{#if:link|link=}} parameter is useful where a link is placed in a colored header such as a navbox. For example, if the header was blue, you would leave the background color blank and set the font color to white. |{{#if:link|link=}}yes sets the link to the text, otherwise it is set to the value of |{{#if:link|link=}}.

Markup Renders as
{{font color|white|blue|Wikipedia:Example|link=yes}} {{ safesubst:#if: Wikipedia:Example {{ safesubst:#if: yes yes Wikipedia:Example Wikipedia:Example
     }}
Wikipedia:Example
   }}
{{ safesubst:#if: yes yes blue blue
   }}
blue
 }}

}}

{{font color|white|blue|Wikipedia:Example|link=Wikipedia:Sandbox}} {{ safesubst:#if: Example {{ safesubst:#if: Wikipedia:Sandbox yes Example Example
     }}
Example
   }}
{{ safesubst:#if: Wikipedia:Sandbox yes blue blue
   }}
blue
 }}

}}

See also