Template:FAQItem: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary Tag: Reverted |
mNo edit summary Tag: Reverted |
||
| Line 44: | Line 44: | ||
<!-- Generate a stable anchor ID from the question text --> | <!-- Generate a stable anchor ID from the question text --> | ||
<!-- | <!-- Precompute everything BEFORE entering HTML mode --> | ||
{{#vardefine:frag|{{anchorencode:{{{question}}}}} }} | |||
{{#vardefine:q|{{{question}}}}} | |||
{{#vardefine:a|{{{answer}}}}} | |||
< | <span id="{{#var:frag}}"></span> | ||
{{# | |||
<html> | <html> | ||
<details class="faq-item"> | <details class="faq-item"> | ||
< | <summary style="font-weight: bold; font-size:larger;"> | ||
{{#var:q}} | |||
</summary> | |||
<div style="margin:0.5em 0 1em 0; font-size:smaller; opacity:0.7;"> | <div style="margin:0.5em 0 1em 0; font-size:smaller; opacity:0.7;"> | ||
<a href="#" class="copy-link" data-frag="{{#var:frag}}"> | <a href="#" class="copy-link" data-frag="{{#var:frag}}"> | ||
| Line 62: | Line 65: | ||
<blockquote class="faq-answer"> | <blockquote class="faq-answer"> | ||
{{ | {{#var:a}} | ||
</blockquote> | </blockquote> | ||
</details> | </details> | ||
Revision as of 00:58, 27 February 2026
Creates a FAQ item with collapsible details and a permalink
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Question | question | The Question | String | required |
| Answer | answer | The Answer to the question | String | required |
FAQItem usage
- Copy text between the horizontal lines for each Question with Answer
- Put the Question after | question =
- Put the Answer after | answer =
{{FAQItem
| question =
| answer =
}}
The FAQItem will render as it appears below this line.
{{#vardefine:frag|{{{question}}} }}
{{#vardefine:q|{{{question}}}}}
{{#vardefine:a|{{{answer}}}}}