Which built-in type fits which purpose, how categories, tags, slugs, custom URLs and SEO settings behave across them, how revisions and publishing gate what the public sees, how to model a domain the platform has no type for, and where uploaded files live.
L1–L3
Unit 01 · The built-in content types
FAQ pages and questions
The built-in content typesPage 5 of 35Updated
The FAQ module holds questions, each with one answer, and FAQ pages that list them in a tree. What each record carries, the routes and variables, rendering a page's questions in both engines, building your own voting or ranking, and why it is often the right home for troubleshooting content.
Who this is for. The content modeller with a knowledge base or troubleshooting content to publish, and the theme developer writing its templates. Afterwards you can model answers as questions, group them on FAQ pages, and render both.
Two records: questions and FAQ pages
A question carries the question text (getQuestion()) and its answer in the layout areas of its active revision. It has a slug, its own layout, tags and categories (both on by default), SEO settings, a custom URL and a state for triage: New, Pending, Rejected or Answered. A question's slug is unique on its site.
An FAQ page is a page of its own module: a tree of FAQ pages, each with a layout, areas and an ordered list of questions. The list belongs to the page's revision, so reordering or removing questions is versioned with the page and can be rolled back. A revision of an FAQ page must list at least one question. One question can appear on several FAQ pages without being copied.
Routes and variables
Path
Shows
Template
Variables
/faq/page/<path>
An FAQ page, by the slugs of the tree
Its layout's template, else faq/pages/show.html
page, record
/faq/question/<slug>
One question
Its layout's template, else faq/questions/show.html
faq is the module's default URL prefix, which a site can change, and both kinds of record can carry a custom URL: this site's Troubleshooting section is an FAQ page. The framework ships none of the templates. Rendering an FAQ page's questions:
Template codefaq/pages/show.html
{$revision = $page->getActiveRevision()}
{foreach $revision->getQuestions(null, 'position', 'ASC') as $question}
{if !$question->isPublished()}{continue}{/if}
<details>
<summary>{$question->getQuestion()|escape}</summary>
{$question->answer}
<a href="{$question->getFullPath()}">Link to this answer</a>
</details>
{/foreach}
{% set revision = page.getActiveRevision() %}
{% for question in revision.getQuestions(null, 'position', 'ASC') %}
{% if question.isPublished() %}
<details>
<summary>{{ question.getQuestion()|e }}</summary>
{{ question.answer }}
<a href="{{ question.getFullPath() }}">Link to this answer</a>
</details>
{% endif %}
{% endfor %}
The answer's area name, answer here, is whatever the question's layout calls it. Visitors receive only published questions; a signed-in editor receives the unpublished ones too, which the isPublished() check hides so the two views match. To show part of a page's list, the FAQ page filters it for you: getQuestionsByTagSlugs([...]), getQuestionsByCategorySlugs([...]) and their ...Names variants, each matching any of the values given.
Comments, and building your own ranking
Questions carry comments, records of their own that are moderated in the admin and are reachable through the API (Question Comments); new ones are unpublished by default. The module has no frontend route that accepts a comment, so a comment form on the site posts to a form or a custom endpoint of your own.
Ordering is the editor's, by position on each FAQ page. Build a "was this helpful" button as a form, and a ranking from it as a job that writes the counts somewhere a template can read them.
Why FAQ suits troubleshooting content
Teams often put troubleshooting answers in a blog, and readers then meet dates that mean nothing and a stream nobody reads in order. A question is the better shape: it is found by its symptom, has one canonical answer at one URL, and can be listed on every FAQ page where it applies, grouped by product area or by symptom, without copying. Tags give a symptom facet across the whole set and categories a product tree, through the /faq/questions routes. This site's Troubleshooting section is built that way: one landing FAQ page, a child FAQ page per group of symptoms, and each answer a question.