Etch component

FAQ Item 1

One FAQ question with a rich answer slot or sanitized HTML from a normalized loop item.

FAQ Item 1

Copy FAQ Item 1

Configurator settings

Change a setting in the configurator to include it.

Optional. Copies the component under its own name, such as News Card Alpha for a site.

Documentation

One question and its answer, for MAC FAQ Accordion 1. The question is a button that opens and closes the answer.

How to use it

  • Set Question, and put the answer in the answer slot, which takes any content: text, lists, links or images.
  • In a loop, pass the answer as HTML in Answer HTML instead. It's sanitized, so scripts and unsafe markup are removed.
  • In a loop over posts whose item is named item, set Question to {item.title} and Answer HTML to {item.content}, the post's content as written in the editor.
  • For an ACF field, such as a WYSIWYG field named answer, use {item.acf.answer}. For a custom field (post meta) named answer, use {item.meta.answer}.
  • Icon swaps the chevron.

Good to know

  • Use it inside MAC FAQ Accordion 1: the accordion's script opens and closes the answers, and together they form a description list (dl, dt and dd).
  • {item.acf.answer} gives the field as ACF formats it, with paragraphs added, and {item.meta.answer} gives the value as it's stored.
  • The demo shows an item with its answer in the slot, then three from a loop over a JSON list on the hub, with Question {item.question} and Answer HTML {item.answer}. Copy JSON gives the first item only.

Reference

Read from the component's JSON, so it's always current.

Loading the reference