Content Modules

Add a FAQ to your site

Aktualisiert am 126 Aufrufe

A FAQ item is one question and its answer: the title is the question and the body is the answer. It has no page of its own. Your site shows the items of one category on a page you already have, the way kookee.dev/pricing shows five questions from a category called pricing.

Write the items

  1. Open FAQ under Content in your project.

  2. Click Manage categories.

  3. Click New category.

  4. Name the category after the page that will show it, such as Pricing. Its slug, pricing, is the name your code uses.

  5. Click Create category.

  6. On the category's page, click New FAQ item. The Category card already holds the category.

  7. Enter the question.

  8. Write the answer below it.

  9. Set the status at the top of the form to Published.

  10. Click Create FAQ item.

An item sits in one category. To show it on two pages, click Duplicate in its row's menu. The copy opens as a draft with " (copy)" at the end of the question. Remove that, pick the other category in the Category card, set the status to Published and click Save changes. Repeat this for each language, since Duplicate copies them all. The two items are separate from then on: an edit to one doesn't reach the other.

Show them on a page

PricingFaq below is a server component for the Next.js App Router. It needs version 1.21.0 of @kookee/sdk and @kookee/react.

tsx
import { Kookee, getFaqJsonLd, serializeJsonLd } from '@kookee/sdk';
import { FaqList } from '@kookee/react/faq';

const kookee = new Kookee({ apiKey: process.env.KOOKEE_API_KEY! });

export async function PricingFaq() {
  const faq = await kookee.faq.list({ category: 'pricing', locale: 'en', limit: 50 });
  if (faq.data.length === 0) return null;
  const faqJsonLd = getFaqJsonLd(faq.data);

  return (
    <section>
      <h2>Frequently asked questions</h2>
      <FaqList items={faq.data} defaultOpen={0} />
      {faqJsonLd && (
        <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: serializeJsonLd(faqJsonLd) }} />
      )}
    </section>
  );
}

category takes the slug in your project's default language and finds the category in every language, so the page names it once. Unlike other lists, a FAQ list carries every answer as contentHtml and contentText. The items arrive in the order you set on the category's page: see Set the order of help articles and FAQ items.

FaqList renders each item as a native <details> and <summary>, so a question opens before any JavaScript has loaded. It needs no provider, and it renders nothing for an empty list. defaultOpen takes the index of the item that starts open. Import @kookee/react/content.css once at the root of your app, or the list renders unstyled. React components for your blog, changelog and help center covers the stylesheets.

Two other ways to read the same list:

  • In a client component inside KookeeProvider, useFaq({ category: 'pricing', limit: 50 }) returns the items in data, and useFaqCategories() the categories, for a page with one section per category.

  • Without the SDK, request GET /v1/entries?type=faq&category=pricing&limit=50 and render contentHtml yourself. Using the REST API without the SDK covers the key and the headers.

getFaqJsonLd turns the items into schema.org FAQPage markup. Google stopped showing FAQ rich results on May 7, 2026, so the markup earns no rich result there. It states the page's questions and answers in a form any crawler can read. Leave it out if you don't need that.

Translate the items

Each language has its own version of an item and of its category, so translate the category first. The Translations controls appear when the project has more than one language.

  1. Click Manage categories.

  2. Open the category.

  3. Under Translations, click the language's code, such as DE.

  4. Name the category.

  5. Click Create category.

  6. On the item's page, click the language's code in the Translations card.

  7. Write the question.

  8. Write the answer.

  9. Set the status to Published.

  10. Click Create FAQ item.

The translation starts in that language's version of the category, and every language of an item keeps the same place in the order.

kookee.faq.list falls back to the default language for an item with no published translation. Pass fallback: false to leave that item out instead, as kookee.dev does on its pricing page.

Where FAQ items show

The site widget's assistant searches FAQ items and cites them the way it cites help articles. The widget opens such a source in its own reader. If you set onSourceClick, a FAQ source has type: 'faq' and slug: null, so send it to the page that shows the FAQ instead of /help/${source.slug}.

FAQ items stay out of the hosted portal, the widget's Help tab, the sitemap, the RSS feeds and llms.txt.

Variables and webhooks in FAQ items

Put a config value in an answer as a variable, and the answer shows its current value: see Show config values in your content with variables.

A change to a published item sends entry.published, entry.updated, entry.unpublished or entry.deleted, with type: "faq" and slug: null: see Send events to your site with webhooks.

Continue reading

War dieser Artikel hilfreich?