Configuration 

Ai3 Core Dependency 

Ai3 FAQ relies on the configuration of Ai3 Core. Ensure that wegewerk/ai3_core is properly installed and configured with valid API credentials for the ZAK-AI service.

API Credentials 

The API credentials for the ZAK-AI service are provided via environment variables consumed by Wegewerk\Ai3Core\Api\ZakAiClient:

  • ZAKAI_API_KEY -- your ZAK-AI API key.
  • ZAKAI_SECRET -- your ZAK-AI secret.

Set these environment variables in your system or in your .env file:

Environment variables
export ZAKAI_API_KEY=your-api-key-here
export ZAKAI_SECRET=your-secret-here
Copied!

Bootstrap Package Integration 

The extension requires bk2k/bootstrap-package for accordion functionality. The FAQ content element uses the Bootstrap Package accordion configuration and FlexForm settings.

The accordion configuration is automatically applied via TCA:

TCA configuration for accordion
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
    '*',
    'FILE:EXT:bootstrap_package/Configuration/FlexForms/Accordion.xml',
    'ai3_faq'
);
Copied!

Schema.org Configuration 

The extension uses brotkrueml/schema to generate structured data markup for FAQ pages. This improves SEO and enables rich snippets in search results.

The schema markup is automatically generated when the FAQ is rendered on the frontend, using the FAQPage schema type.

TypoScript 

The extension automatically loads its TypoScript configuration. The setup includes:

TypoScript configuration
# Content element registration
tt_content.ai3_faq < lib.contentElement
tt_content.ai3_faq {
    templateName = Accordion
    # Uses Bootstrap Package accordion template
}
Copied!

Backend AJAX Routes 

The extension registers AJAX routes for backend communication:

Backend/AjaxRoutes.php
return [
    'ai3_faq_generate' => [
        'path' => '/ai3/faq/generate',
        'target' => \Wegewerk\Ai3Faq\Controller\Ajax\ArticlefaqController::class . '::getFaq'
    ],
];
Copied!

Language Support 

The extension currently supports German (de) language output from the ZAK-AI API. Additional languages can be configured by modifying the language options in the JavaScript module:

Language configuration in faq.js
getLanguageOptions() {
     return [
         {
             value: 'de',
             label: 'Deutsch'
         }
         // Add more languages here
     ]
}
Copied!

Customization Options 

Accordion Styling 

The FAQ accordion inherits styling from Bootstrap Package. You can customize the appearance by overriding Bootstrap variables or CSS classes:

Custom accordion styling
.accordion-item {
    /* Custom FAQ accordion styling */
}
Copied!

Template Override 

To customize the FAQ output template, override the Accordion template from Bootstrap Package in your site package:

Template path
EXT:your_sitepackage/Resources/Private/Templates/ContentElements/Accordion.html
Copied!

Field Configuration 

The extension adds custom TCA fields that can be configured:

Custom TCA fields
'tx_ai3_faq_generator' => [
    'exclude' => true,
    'label'   => 'LLL:EXT:ai3_faq/Resources/Private/Language/locallang.xlf:tx_ai3.faq.generator',
    'config'  => [
        'type'       => 'user',
        'renderType' => 'ai3FaqGeneratorElement',
    ],
]
Copied!