Plain FAQ

Classification

plain_faq

Version

4.0

Language

en

Description

Plain FAQ

Keywords

faq, frequently asked questions

Copyright

2019

Author

Torben Hansen

Email

torben@derhansen.com

License

This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml

Rendered

Mon, 28 Apr 2025 14:39:56 +0000

The content of this document is related to TYPO3, a GNU/GPL CMS/Framework available from www.typo3.org.

Table of Contents

What does it do?

This extension for TYPO3 CMS is a solution to manage frequently asked questions. The focus of the extension is to keep things simple and to have a modern and clean code basis.

Summary of features

  • Easy usage for editors
  • Uses TYPO3 system categories to structure FAQs by category
  • Field for media and files
  • Possibility to add related FAQs
  • Configurable template layouts for the views
  • Automatic cache clearing when FAQ has been changed in backend
  • Symfony Console commands to migrate from ext:irfaq
  • Signal slots to extend the extension with own functionality

Background

  • Based on Extbase and Fluid
  • Covered with many unit and functional tests
  • Actively maintained

Screenshots

FAQ backend form

FAQ backend form

Updates and support

The source code of this extension is hosted on GitHub. Please report bugs and changerequests directly at https://github.com/derhansen/plain_faq

Updates will be published directly on TER and Packagist.

Say thanks

If you like this extension and want to say thanks, feel free to drop me an e-mail or sponsor the development of the extension. Please also consider to support the TYPO3 community by sponsoring events, code sprints or by becoming a TYPO3 association member.

Thanks from me to:

The initial development of this extension was sponsored by Julius-Maximilians-Universität Würzburg (https://www.uni-wuerzburg.de). Thanks a lot for supporting TYPO3 and open source software! 👍

Thanks to Georg Ringer for https://github.com/georgringer/numbered_pagination which has been integrated into this extension

FAQs

FAQs are the main record of this extesion. A FAQ contains several fields, which are used to describe the frequently asked question.

General

The general tab is used to add general information about the FAQ like a question, answer and categories.

FAQ general tab

Field:

Description:

Question

The Question

URL Segment

URL slug field

Answer

The answer to the questions

Keywords

One or multiple keywords

Categories

You can assign one or multiple categories to a FAQ.

FAQ category tab

Field:

Description:

Category

One or multiple categories for the FAQ

Media

If media items are required for a FAQ, you can add images or files.

FAQ media tab

Field:

Description:

Images

One or multiple images for the FAQ

Files

One or multiple files for the FAQ

Relations

The relations tab contains a fiels to select related FAQs.

FAQ related tab

Field:

Description:

Related FAQs

One or multiple related FAQ records

Categories

You can create categories to structure FAQ records in the frontend (e.g. show FAQs which belong to one or more categories)

Since the extension uses TYPO3 system categories, you create new categories by choosing "System records" -> "Category"

Installation

The installation and initial configuration of the extension is as following:

  1. Install the extension with the extension manager or using composer
  2. Include the static TypoScript configuration “Plain FAQ (plain_faq)” in your TypoScript template
  3. Create a new sysfolder in your page tree, where you create FAQs and categories.
  4. Depending on your needs, create a TYPO3 page for FAQ listing and FAQ details.
  5. Add the plugin FAQs to the newly created pages and configure the plugin settings.
  6. Configure extension TypoScript settings depending on your needs.

FAQs

Nearly all important settings can be made through the plugin, which override the settings made with TypoScript. All plugin settings can also be configured with TypoScript (use plugin.tx_plainfaq_pi1.settings. with the keys shown below).

Tab settings

Property:

View:

Description:

Key:

What to display

All

Which view should be shown on the given page.

Available options:

  • List view
  • List view (without overloading detail view)
  • Detail view
 

Sort by

List

Defines which field should be used for sorting FAQs in the frontend. The default sorting field is "none", which can be overridden by using this setting.

orderField

Sorting direction

List

Defines the sorting direction for orderField. The default sorting direction is "asc", which can be overridden by using this setting.

Possible values:

  • <empty value>
  • asc
  • desc

orderDirection

Max records displayed

List

Maximum amount of FAQ articles to return

queryLimit

Category mode

List

This setting defines, how categories are taken into account when selecting FAQs.

The following options are available:

  • Ignore category selection
  • Show FAQs with selected categories (OR)
  • Show FAQs with selected categories (AND)
  • Do NOT show FAQs with selected categories (NOTOR)
  • Do NOT show FAQs with selected categories (NOTAND)

categoryConjunction

Category

List

Restrict FAQs to be shown by one or more category

category

Include subcategory

List

Includes subcategories of the selected category

includeSubcategories

Record storage page

List

One or more sysfolders, where FAQs are stored

storagePage

Tab additional

Detail Page

List

Page, where plugin is configured to show FAQ details

detailPid

List Page

Details

Page, where the listview for FAQs is shown. Only available, when the plugin is configured to show FAQ details.

listPid

Disable Override demand

List

If set, the settings of the plugin can't be overridden by arguments in the URL.

disableOverrideDemand

Tab pagination

Enable pagination

List

If checked, pagination will be generated and pagination variables will be given to the view.

enablePagination

Items per page

List

Items per page for the pagination

itemsPerPage

Maximum number of pages

List

Maximum number of pages

maxNumPages

Tab template

Property:

View:

Description:

Key:

Template layout

List

With this setting the plugin can be configured to show different template layouts.

  • Template layouts can be configured with Page TSConfig.
  • Template layout can be used/set by TypoScript (settings.templateLayout)

templateLayout

TypoScript reference

More TypoScript settings are available on the FAQs page. Also make sure to check the included setup.txt file for available/default TypoScript settings.

plugin.tx_plainfaq

Property:

Data type:

Description:

Default:

view.templateRootPath

String

Path to the templates. The default setting is EXT:plain_faq/Resources/Private/Templates/

Extbase default

view.partialRootPath

String

Path to the partials. The default setting is EXT:plain_faq/Resources/Private/Partials/

Extbase default

view.layoutRootPath

String

Path to the layouts. The default setting is EXT:plain_faq/Resources/Private/Layouts/

Extbase default

settings.orderFieldAllowed

String

Comma separated list of fields that are allowed to be set as order fielfs

uid,question,sorting

Page TSConfig

The following Page TSConfig can be used with the extension.

Property:

Data type:

Description:

templateLayout

array

With this setting the plugin can be configured to show different template layouts. Template layouts can be configured like shown below.:

tx_plainfaq_pi1.templateLayouts {
  1 = 2 column layout
  2 = FAQ-Slider
}
Copied!

Template layout can be used/set by TypoScript (settings.templateLayout)

Changing paths of the template

Please do never change templates directly in the Ressources folder of the extensions, since your changes will get overwritten by extension updates.

Configure your TypoScript setup like shown below (note the plural of the path-name):

plugin.tx_plainfaq {
  view {
    templateRootPaths {
      0 = {$plugin.tx_plainfaq_pi1.view.templateRootPath}
      1 = fileadmin/templates/faq/Templates/
    }
    partialRootPaths {
      0 = {$plugin.tx_plainfaq_pi1.view.partialRootPath}
      1 = fileadmin/templates/faq/Partials/
    }
    layoutRootPaths {
      0 = {$plugin.tx_plainfaq_pi1.view.layoutRootPath}
      1 = fileadmin/templates/faq/Layouts/
    }
  }
}
Copied!

Doing so, you can just override single files from the original templates.

Using template layouts for listview

Different template layouts can be configured in Page TSConfig.:

tx_plainfaq_pi1.templateLayouts {
  1 = 2 column layout
  2 = FAQ-Slider
}
Copied!

This TypoScript above defines 2 new template layouts, which will appear in the template layout selectbox in the plugin settings like shown below.

Different template layouts

The choosen template layout can be used in the fluid templates as shown below.:

<f:if condition="{settings.templateLayout} == 1">
  <f:render partial="List/Faq-Slider" arguments="{faqItem: faq, settings:settings}"/>
</f:if>
Copied!

Template objects

The following objects are available in the different views.

Please have a look at the templates included with the extension, since they show many of the properties of the given objects and how to use them.

Tip: You can use <f:debug>{object}</f:debug> in your template to see available properties of each object.

Plugin: FAQs

List view

Object:

Description:

{faqs}

An object holding all FAQs that matched the configured demand in the plugin settings

{faqDemand}

The faqDemand object

{overwriteDemand}

The overwriteDemand object

{contentObjectData}

The current content object of the plugin

{pageData}

The current page data

Detail view

Object:

Description:

{faq}

An object holding the given FAQ

{contentObjectData}

The current content object of the plugin

{pageData}

The current page data

Migration from "irfaq"

If you use the TYPO3 extension "irfaq", then you migrate to "Plain FAQ" using 3 Symfony Console commands. Note, that the migration has some limits and does not support all fields "irfaq" has.

Migration is done in 4 steps:

Step 1 - Migrate categories

Command:

./typo3/sysext/core/bin/typo3 plain_faq:migrate_categories
Copied!

This command migrates all categories of "irfaq" to TYPO3 sys_categories. Note, that the fields shortcut and fe_group are not supported.

The migrator creates a new category on root level called "FAQ". All pages, where "irfaq" categories are found will be created as child categories of the root "FAQ" category and all "irfaq" categories will be created as child categories per page

Example:

  • FAQ
    • Page 1
      • Category 1 on Page 1
      • Category 2 on Page 2
    • Page 2
      • Category 1 on Page 2
      • Category 2 on Page 2
      • ...

Step 2 - Migrate FAQs

Command:

./typo3/sysext/core/bin/typo3 plain_faq:migrate_faqs
Copied!

This command simply migrates all "irfaq" to "Plain FAQ" records. The following fields are not supported (mostly due to features not available in "Plain FAQ")

  • q_from
  • expert
  • related
  • related_links
  • faq_files
  • enable_ratings
  • disable_comments
  • comments_closetime

Step 3 - Migrate Plugins

Command:

./typo3/sysext/core/bin/typo3 plain_faq:migrate_plugins
Copied!

Options:

  • -d, --defaultOrderField[=DEFAULTORDERFIELD] The default order field when no sort order is defined in the ext:irfaq plugin
  • -p, --pids[=PIDS]

This command migrates all Plugins from "irfaq" to "Plain FAQ" plugins. Note, that existing "irfaq" plugins will simply be replaced (fields list_type and pi_flexform will be replaced).

The migration migrates the following settings:

  • storagePage
  • Recursive
  • orderField (if set - if not set, you can specify a defaultOrderField)
  • categoryConjunction
  • categories

Step 4 - Update module icon for pages

In order to update the folder icon on the pagetree, you must execute the following SQL query.

SQL:

UPDATE pages SET module="faqs" WHERE module="irfaq"
Copied!

Note, that this step is only necessary when you have used the folder icon from ext:irfaq

After all migration steps (1 to 3) are processed, you should check, if the migration worked as expected. Feel free to modify the migrator to suite your own needs.

PSR-14 Events

The extensions contains many PSR-14 Events which make it possible to extend the extension with own functionality.

Please note, that there is no documentation for each PSR-14 event in detail, so you have to check each event individually for supported properties. Generally I tried to make the events as self explaining as possible.

If you are new to PSR-14 Events, please reffer to the official TYPO3 documentation about PSR-14 Events and Event Listeners.

https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Hooks/EventDispatcher/Index.html

The following PSR-14 Events are available:

Faq Controller

  • ModifyListViewVariablesEvent
  • ModifyDetailViewVariablesEvent

Faq Repository

  • ModifyFaqQueryConstraintsEvent