Template:OOO-FAQ: Difference between revisions

Created page with "<includeonly> <div class="ooo-faq"> {{{content|}}} </div> </includeonly> <noinclude>{{Documentation}}</noinclude>"
 
m updated faq limit ( 10 visual & with source edit can add infinite)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
<includeonly>{{#invoke:OOOFAQ|render}}</includeonly><noinclude>
<div class="ooo-faq">
{{{content|}}}
</div>
</includeonly>


<noinclude>{{Documentation}}</noinclude>
= OOO FAQ Template =
 
Creates collapsible FAQ sections styled for the Out of Ore Wiki.
 
== Usage ==
 
<pre>
{{OOO-FAQ
| question1 = How does power work?
| answer1  = Power is generated by generators and distributed through cables.
 
| question2 = Can conveyors merge?
| answer2  = Yes. Use splitters/junctions and plan throughput.
 
| question3 = Does multiplayer share power grids?
| answer3  = Yes, if the machines/cables are connected into the same network.
}}
</pre>
 
== Add more than 10 questions ==
The VisualEditor form shows 10 fields, but the template supports unlimited entries.
 
To add more:
# Click “Edit source” (or switch to wikitext/source mode).
# Add new pairs by continuing the numbering:
 
<pre>
| question11 = Your question
| answer11  = Your answer
 
| question12 = Your question
| answer12  = Your answer
</pre>
 
== Notes ==
* Use matching numbers: questionX with answerX.
* Answers can include wiki formatting, links, lists, and multiple paragraphs.
 
<templatedata>
{
  "description": "Creates collapsible FAQ sections (up to 10 fields in VisualEditor; unlimited in source mode).",
  "params": {
    "question1": { "label": "Question 1", "type": "string" },
    "answer1":  { "label": "Answer 1", "type": "content" },
 
    "question2": { "label": "Question 2", "type": "string" },
    "answer2":  { "label": "Answer 2", "type": "content" },
 
    "question3": { "label": "Question 3", "type": "string" },
    "answer3":  { "label": "Answer 3", "type": "content" },
 
    "question4": { "label": "Question 4", "type": "string" },
    "answer4":  { "label": "Answer 4", "type": "content" },
 
    "question5": { "label": "Question 5", "type": "string" },
    "answer5":  { "label": "Answer 5", "type": "content" },
 
    "question6": { "label": "Question 6", "type": "string" },
    "answer6":  { "label": "Answer 6", "type": "content" },
 
    "question7": { "label": "Question 7", "type": "string" },
    "answer7":  { "label": "Answer 7", "type": "content" },
 
    "question8": { "label": "Question 8", "type": "string" },
    "answer8":  { "label": "Answer 8", "type": "content" },
 
    "question9": { "label": "Question 9", "type": "string" },
    "answer9":  { "label": "Answer 9", "type": "content" },
 
    "question10": { "label": "Question 10", "type": "string" },
    "answer10":  { "label": "Answer 10", "type": "content" }
  },
  "paramOrder": [
    "question1","answer1",
    "question2","answer2",
    "question3","answer3",
    "question4","answer4",
    "question5","answer5",
    "question6","answer6",
    "question7","answer7",
    "question8","answer8",
    "question9","answer9",
    "question10","answer10"
  ]
}
</templatedata>
 
</noinclude>