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:
export ZAKAI_API_KEY=your-api-key-here
export ZAKAI_SECRET=your-secret-here
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:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
'*',
'FILE:EXT:bootstrap_package/Configuration/FlexForms/Accordion.xml',
'ai3_faq'
);
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:
# Content element registration
tt_content.ai3_faq < lib.contentElement
tt_content.ai3_faq {
templateName = Accordion
# Uses Bootstrap Package accordion template
}
Backend AJAX Routes
The extension registers AJAX routes for backend communication:
return [
'ai3_faq_generate' => [
'path' => '/ai3/faq/generate',
'target' => \Wegewerk\Ai3Faq\Controller\Ajax\ArticlefaqController::class . '::getFaq'
],
];
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:
getLanguageOptions() {
return [
{
value: 'de',
label: 'Deutsch'
}
// Add more languages here
]
}
Customization Options
Accordion Styling
The FAQ accordion inherits styling from Bootstrap Package. You can customize the appearance by overriding Bootstrap variables or CSS classes:
.accordion-item {
/* Custom FAQ accordion styling */
}
Template Override
To customize the FAQ output template, override the Accordion template from Bootstrap Package in your site package:
EXT:your_sitepackage/Resources/Private/Templates/ContentElements/Accordion.html
Field Configuration
The extension adds custom TCA fields that can be configured:
'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',
],
]