Template:FAQ: Difference between revisions

From Descent-Community Wiki 1.2
Jump to navigation Jump to search
(Automatically add pages which have a reference to the FAQ to their own category)
No edit summary
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#switch:{{{version|}}}
<noinclude>{{FAQ
  |1.5 = {{#if:{{{page|}}} | {{FAQ_1.5 |page={{{page|}}} }} | {{FAQ_1.5}} }} [[Category:FAQProblems]]
|question  = Am i a question?
  |1.6 = {{#if:{{{page|}}} | {{FAQ_1.6 |page={{{page|}}} }} | {{FAQ_1.6}} }}
|answer    = Yes, this is an answer<br>It has multiple lines.<br>Even more lines to show how it looks.
  |#default  = {{#if:{{{page|}}} | {{FAQ_1.6 |page={{{page|}}} }} | {{FAQ_1.6}} }} [[Category:FAQProblems]]
|source    = https://wiki.descent-community.org
}}[[Category:FAQ]]</includeonly>
|reference = I'm just a reference
<noinclude>{{documentation}}</noinclude>
}}</noinclude><includeonly>{{ #vardefine: def_icon | {{#if: {{{icon|}}} | {{{icon|}}} | [[File:Icon_-_Descent.png|50px]]}}
}}{{#if:{{{question|}}} |
  {{#if:{{{answer|}}} |
    {{#if:{{{source|}}} |
      {{#if:{{{reference|}}} |
        <div style="vertical-align:bottom; margin-bottom:5px; background-color:lightgrey; padding:5px; border-top-left-radius:15px; border-top-right-radius:15px; border-bottom-right-radius:15px; border-bottom-left-radius:15px;min-width:270px;overflow:hidden;">
          <div style="display:table;width:100%;">
            <div style="display:table-caption;width:100%">'''{{{question|}}}'''</div>
            <div style="width:100%; vertical-align: middle; display:table-row;">
              <div style="text-align:center; width:55px; display:table-cell; vertical-align: middle;">{{#var: def_icon}}</div>
              <div style="min-height:64px; display:flex; flex-wrap: wrap; align-items: center;">
                <div style="border:1px solid RGB(85,172,238); border-top-left-radius:15px; border-top-right-radius:15px; border-bottom-right-radius:15px; border-bottom-left-radius:15px; padding:7px; background-color:white;">{{{answer|}}}</div>
                <div style="align-self:flex-end; flex-grow:1; text-align:right;">{{Source|{{{source|}}}}} {{{reference|}}}</div>
              </div>
            </div>
          </div>
        </div>
      }}
    }}
  }}
}}[[Category:FAQ]]</includeonly><noinclude>{{documentation}}</noinclude>

Latest revision as of 13:04, 22 April 2017

Am i a question?
Yes, this is an answer
It has multiple lines.
Even more lines to show how it looks.
Source[1] I'm just a reference
Template documentation (for the above template, sometimes hidden or invisible)

Description

  • This template is not intended to be used directly. It provides the formatting for FAQ entries.
  • Please use the Templates: UFAQ or OFAQ

Syntax

All parameters are required. The FAQ box will not be drawn if at least one of these parameters is missing.

{{FAQ
|question  = <mandatory> The question.
|answer    = <mandatory> The answer to the question.
|source    = <mandatory> A link where the answer is from.
|reference = <mandatory> Who gave the answer.
|icon      = <optional> The icon which is shown on the left side. Defaults to the descent D.
}}

Visit Template:FAQ/doc to edit this text! (How does this work?)