Custom Feature Cards
Use custom AI Features when your extension needs settings cards inside AI Foundation > AI Features. These cards are used for extension-specific AI configuration such as feature toggles, defaults, API-related options, and provider choices.
Purpose
AI Features are not prompt templates and not MCP tools. They are configuration surfaces for extensions that use AI Foundation.
AI Foundation renders the card, drawer, AJAX save/load flow, and per-site storage. Your extension provides the card metadata, allowed settings scope, and field schema.
Architecture
- Settings schema
Configuration/points to the field definition file.Extension Settings/ schema. php - Field definitions
Configuration/defines the fields shown in the drawer.Extension Settings/ fields. typoscript - Card provider
Aireturns one or more cards for the AI Features overview.Feature Card Provider Interface - Scope provider
Extensiondeclares which settings scopes your extension accepts.Settings Scope Provider Interface - Storage
- Values are stored by AI Foundation in
tx_for the selected site context.nst3af_ extension_ setting
Implementation steps
- Add
schema.andphp fields.to your extension.typoscript - Implement
Ai.Feature Card Provider Interface - Implement
Extension.Settings Scope Provider Interface - Tag both services in your extension.
- Read saved values at runtime through the AI Foundation settings service.
- Flush caches and verify the card in AI Foundation > AI Features.
Schema example
<?php
declare(strict_types=1);
return [
'fieldsTemplate' => __DIR__ . '/fields.typoscript',
];
Field example
The category in # cat= must match the card’s settings.
# cat=my ext settings//01; type=boolean; label=Enable AI-assisted generation
enableAiFeature = 0
# cat=my ext settings//02; type=int+; label=Default number of suggestions
defaultSuggestionCount = 3
Service registration
services:
_defaults:
autowire: true
autoconfigure: true
_instanceof:
NITSAN\NsT3AF\Contract\AiFeatureCardProviderInterface:
tags: ['t3af.ai_feature_card_provider']
NITSAN\NsT3AF\Contract\ExtensionSettingsScopeProviderInterface:
tags: ['t3af.extension_settings_scope']
MyVendor\MyExt\Feature\:
resource: '../Classes/Feature/'
Runtime usage
Read settings through the AI Foundation settings API instead of parsing extension configuration manually. The saved values are merged with schema defaults.
$settings = $this->extensionSettingsService->getAll('my_ext', $storagePid);
$enabled = ($settings['enableAiFeature'] ?? '0') === '1';
Best practices
- Keep
settingsstable.Scope - Use clear labels because editors see them in the backend drawer.
- Do not overload one card with unrelated feature groups.
- Use Feature Provider Overrides when a feature needs its own provider dropdown.
- Flush caches after changing schema or DI definitions.
Verification
- Select a site in AI Foundation.
- Open AI Foundation > AI Features.
- Confirm your card appears.
- Open the drawer and verify fields from
fields..typoscript - Save settings and reopen the drawer.
- Confirm your runtime service reads the saved value.
Troubleshooting
Card is missing
- Confirm the card provider is tagged with
t3af..ai_ feature_ card_ provider - Confirm
isreturnsAvailable () true. - Flush TYPO3 caches.
Drawer says the scope is invalid
- Confirm the card
settingsis listed by your scope provider.Scope - Confirm the
# cat=category matches the same scope.