Difference between revisions of "Template:FAQ row"

From blackwiki
Jump to navigation Jump to search
imported>Primefac
m (Protected "Template:FAQ row": semi-protecting highly-visible templates in response to recent template-space vandalism ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access] (indef...)
imported>Tacsipacsi
(use mw-collapsible instead of this awful NavFrame, clean up a lot of now-unused CSS rules, move the remaining to CSS subpage; add id to the div instead of some span inside the title)
 
Line 1: Line 1:
<div class="NavFrame {{#ifeq:{{{show|}}}|yes||{{#ifeq:{{Str find|{{FULLPAGENAME}}|/FAQ}}|-1|collapsed|{{#ifeq:{{{show|}}}|no|collapsed|}}}}}}" style="background:transparent; border:none; margin:0px; padding:2px 0px 2px 0px;">
+
<div {{#if:{{{index|}}}|id="Q{{{index}}}"}} class="faqrow mw-collapsible {{#ifeq:{{{show|}}}|yes||{{#ifeq:{{Str find|{{FULLPAGENAME}}|/FAQ}}|-1|mw-collapsed|{{#ifeq:{{{show|}}}|no|mw-collapsed|}}}}}}">
<div class="NavHead" style="background:transparent; height:auto; margin:0px; padding:2px 35px 2px 2px; font-weight:bold; text-align:left;">{{#if:{{{index|}}}|Q{{{index}}}{{anchor|Q{{{index}}}}}:}} {{{q|}}}</div>
+
<templatestyles src="FAQ row/styles.css" />
<div class="NavContent" style="background:transparent; margin:2px 0px 2px 15px; padding:2px; font-weight:normal; text-align:left;">{{#if:{{{index|}}}
+
<div class="faqrow-title">{{#if:{{{index|}}}|Q{{{index}}}:}} {{{q|}}}</div>
 +
<div class="faqrow-body mw-collapsible-content">{{#if:{{{index|}}}
 
|{{#ifeq:{{str_sub|{{{a|}}}|0|1}}|*
 
|{{#ifeq:{{str_sub|{{{a|}}}|0|1}}|*
 
|'''A{{{index}}}:'''
 
|'''A{{{index}}}:'''

Latest revision as of 15:43, 31 May 2019

Template documentation[view] [edit] [history] [purge]

Script error: No such module "Uses TemplateStyles". Use this template on FAQ subpages.

Parameters

Use

There are three main features:

  1. "index", numbers a specific FAQ. You can link to each specific FAQ that has a unique index on a particular page. For example, to link to FAQ 2 for the Global warming FAQ page, "Talk:Global warming/FAQ#Q2". Follows the pattern "#Q{index}".
  2. "q", stands for question
  3. "a", stands for answer.
{{FAQ row
|index=1
|q=This is some question text...
|a=This is some answer text...
}}
Q1: This is some question text...
A1: This is some answer text...

Show

The box hides the answer on talk page and shows it on the /FAQ page. You may override this by adding "show=yes" so that the answer is always shown, or "show=no" so that the answer is always hidden.

{{FAQ row
|show=yes
|index=2
|q=This is some question text...
|a=This is some answer text...
}}
Q2: This is some question text...
A2: This is some answer text...

See also

Similar templates: