Template:OOO-FAQ: Difference between revisions

mNo edit summary
m updated faq limit ( 10 visual & with source edit can add infinite)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><div class="ooo-faq">{{#if:{{{question1|}}}|<div class="mw-collapsible mw-collapsed ooo-faq__item"><div class="ooo-faq__question">{{{question1}}}</div><div class="mw-collapsible-content ooo-faq__answer">{{{answer1}}}</div></div>}}{{#if:{{{question2|}}}|<div class="mw-collapsible mw-collapsed ooo-faq__item"><div class="ooo-faq__question">{{{question2}}}</div><div class="mw-collapsible-content ooo-faq__answer">{{{answer2}}}</div></div>}}{{#if:{{{question3|}}}|<div class="mw-collapsible mw-collapsed ooo-faq__item"><div class="ooo-faq__question">{{{question3}}}</div><div class="mw-collapsible-content ooo-faq__answer">{{{answer3}}}</div></div>}}{{#if:{{{question4|}}}|<div class="mw-collapsible mw-collapsed ooo-faq__item"><div class="ooo-faq__question">{{{question4}}}</div><div class="mw-collapsible-content ooo-faq__answer">{{{answer4}}}</div></div>}}{{#if:{{{question5|}}}|<div class="mw-collapsible mw-collapsed ooo-faq__item"><div class="ooo-faq__question">{{{question5}}}</div><div class="mw-collapsible-content ooo-faq__answer">{{{answer5}}}</div></div>}}</div></includeonly><noinclude>
<includeonly>{{#invoke:OOOFAQ|render}}</includeonly><noinclude>
 
= OOO FAQ Template =
= OOO FAQ Template =
Creates collapsible FAQ sections styled for the Out of Ore Wiki.


== Usage ==
== Usage ==
<pre>
<pre>
{{OOO-FAQ
{{OOO-FAQ
Line 8: Line 12:
| answer1  = Power is generated by generators and distributed through cables.
| answer1  = Power is generated by generators and distributed through cables.


| question2 = Does multiplayer share power grids?
| question2 = Can conveyors merge?
| answer2   = Yes. Connected systems share the same network.
| 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>
</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>
<templatedata>
{
{
   "description": "Creates collapsible FAQ sections styled for the Out of Ore Wiki.",
   "description": "Creates collapsible FAQ sections (up to 10 fields in VisualEditor; unlimited in source mode).",
   "params": {
   "params": {
     "question1": { "label": "Question 1", "type": "string" },
     "question1": { "label": "Question 1", "type": "string" },
     "answer1":  { "label": "Answer 1", "type": "content" },
     "answer1":  { "label": "Answer 1", "type": "content" },
     "question2": { "label": "Question 2", "type": "string" },
     "question2": { "label": "Question 2", "type": "string" },
     "answer2":  { "label": "Answer 2", "type": "content" },
     "answer2":  { "label": "Answer 2", "type": "content" },
     "question3": { "label": "Question 3", "type": "string" },
     "question3": { "label": "Question 3", "type": "string" },
     "answer3":  { "label": "Answer 3", "type": "content" },
     "answer3":  { "label": "Answer 3", "type": "content" },
     "question4": { "label": "Question 4", "type": "string" },
     "question4": { "label": "Question 4", "type": "string" },
     "answer4":  { "label": "Answer 4", "type": "content" },
     "answer4":  { "label": "Answer 4", "type": "content" },
     "question5": { "label": "Question 5", "type": "string" },
     "question5": { "label": "Question 5", "type": "string" },
     "answer5":  { "label": "Answer 5", "type": "content" }
     "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>
</templatedata>
</noinclude>
</noinclude>