Ai3 Alt Text 

Extension key

|extension_key|

Package name

wegewerk/ai3_alttext

Version

0.9

Language

en

Author

Wegewerk GmbH

License

This document is published under the Creative Commons BY 4.0 license.

Rendered

Fri, 03 Jul 2026 14:19:52 +0000


Ai3 Alt Text is a TYPO3 backend module that generates accessible alternative texts for images using the ZAK-AI REST API. It is part of the Ai3 Suite and requires wegewerk/ai3_core .

Key features:

  • Backend module under File for browsing folders and files in the TYPO3 file storage
  • Batch generation — select multiple images and generate alt texts in one operation
  • Review & approve workflow — AI suggestions are stored separately and must be approved before they are written to file metadata
  • FormEngine field control — add a single file to the generation batch directly from the file metadata edit form
  • Recursive folder actions — accept all AI suggestions across an entire folder tree in one click

This package supports TYPO3 |min_typo3|, 13.4, and 14.0.

Introduction 

What does it do? 

Ai3 Alt Text (|extension_key|) is a TYPO3 extension that automates the creation of accessible alternative texts for images stored in the TYPO3 file storage. It communicates with the ZAK-AI REST API — provided by wegewerk/ai3_core — to generate descriptive, language-aware alt texts using a vision-capable AI model.

The extension adds a dedicated backend module under File > AI3 metadata with two views:

File metadata view
Lists all images in a selected folder. For each image the current alt text, AI-generated suggestion, usage count, and available actions are shown. Editors can generate alt texts individually or in bulk, review suggestions, and approve or edit them before they are saved to the file metadata record.
Folder view
Shows the sub-folder tree of the file storage. Editors can accept all pending AI suggestions across an entire folder hierarchy with a single click.

In addition, a FormEngine field control button is injected into the Alternative Text field of the file metadata edit form, allowing editors to queue a single image for alt text generation without leaving the record editor.

Screenshots 

Requirements 

  • TYPO3 CMS |min_typo3|, 13.4, or 14.0
  • wegewerk/ai3_core (installed automatically as a Composer dependency)
  • A valid ZAK-AI account with ZAKAI_API_KEY and ZAKAI_SECRET environment variables set on the server

Installation 

Installation via Composer 

The recommended way to install ai3-alttext is via Composer:

Install the extension
composer require wegewerk/ai3_alttext
Copied!

This will also pull in wegewerk/ai3_core automatically.

Activate the extension 

After installation, activate the extension in the TYPO3 backend:

  1. Open Admin Tools > Extensions
  2. Find Ai3 Alt Text in the list
  3. Click the Activate button

Database update 

No additional database tables are created by this extension. All generation task data is stored via wegewerk/ai3_core .

Run the database analyser after installation to ensure the core tables are up to date:

Admin Tools > Maintenance > Analyze Database Structure

Configuration 

ai3-alttext has no extension-specific settings in the TYPO3 Extension Manager. All configuration is done via environment variables that are read by wegewerk/ai3_core .

Environment variables 

The following environment variables must be set on the server before the extension can communicate with the ZAK-AI API:

ZAKAI_API_KEY

ZAKAI_API_KEY
Type
string
Default
(empty)

The API key issued by ZAK-AI for your account. When this variable is empty, all API calls will throw a RuntimeException.

ZAKAI_SECRET

ZAKAI_SECRET
Type
string
Default
(empty)

The shared secret used together with ZAKAI_API_KEY to build the HTTP Basic Authorization header (base64(secret + ':' + apiKey)).

Set these variables in your server environment, .env file, or TYPO3 config/system/additional.php:

config/system/additional.php
putenv('ZAKAI_API_KEY=your-api-key');
putenv('ZAKAI_SECRET=your-secret');
Copied!

TCA override 

The extension overrides the alternative column of the sys_file_metadata table to add the Add alttext generation to batch field control button. No manual TCA configuration is required.

JavaScript modules 

The extension registers its JavaScript modules under the @wegewerk/ai3alttext/ namespace via Configuration/JavaScriptModules.php. The following modules are available:

Module Purpose
@wegewerk/ai3alttext/fileList.js Renders the file list and handles bulk selection
@wegewerk/ai3alttext/fileElement.js Handles per-file actions (generate, approve, edit)
@wegewerk/ai3alttext/subFolders.js Renders the folder tree and recursive accept action
@wegewerk/ai3alttext/add-to-batch.js FormEngine field control button behaviour
@wegewerk/ai3alttext/ai3api.js Shared Ajax helper for all backend API calls

Usage 

Backend module 

The extension adds the AI3 metadata module to the File section of the TYPO3 backend. The module has two sub-views, accessible via the button bar at the top:

  • File Metadata — work with images in a specific folder
  • Folders — manage suggestions across the folder tree

File metadata view 

Open File > AI3 metadata and select a folder from the folder tree on the left. The main area shows a table of all images in that folder with the following columns:

Column Description
preview Thumbnail of the image
Title / File File title and file name
alternative Text Current alt text stored in the file metadata record
usages Number of content elements that reference this file
actions Per-file action buttons

Per-file actions 

Each image row provides the following actions:

Action Description
generate alt text with AI Sends the image to the ZAK-AI API and stores the result as an AI suggestion (does not overwrite the existing alt text).
AI Suggestion badge Shown when a suggestion is waiting for review.
approve Copies the AI suggestion into the alternative field of the file metadata record.
edit suggestion Opens an inline editor to modify the suggestion before approving it.
edit metadata Opens the full TYPO3 file metadata edit form.
add alt-text manually Opens an inline text field to enter an alt text without using the AI.

Bulk generation 

Use the selection checkboxes to mark multiple images, then click Generate Alt-Texts with AI to queue all selected images for generation in one operation. The following quick-select helpers are available:

  • select all Images without alt text
  • select all used Images without alt text

After generation completes, click approve all to accept all pending suggestions for the current folder at once.

Folder view 

Switch to the Folders sub-view via the button bar. The view lists all sub-folders of the current storage root together with the number of pending AI suggestions in each folder.

Click Accept %cntGens Suggestions in %cntFolder Subfolders to approve all pending suggestions recursively across the entire folder tree. A flash message confirms how many files were updated.

FormEngine field control 

When editing a file metadata record directly (File > Filelist > Edit metadata), an additional button Add alttext generation to batch appears next to the Alternative Text field. Clicking it queues the current image for alt text generation without leaving the edit form.

The button shows the current generation state:

  • No indicator — no generation task exists yet
  • In progress — a generation task is currently running
  • AI generated — a suggestion is available and waiting for review
  • Approved — the suggestion has already been accepted

Developer corner 

Architecture overview 

ai3-alttext follows the capability pattern introduced by wegewerk/ai3_core . The central pieces are:

Class Responsibility
ZakAiAlttext Implements ZakAiEndpointInterface; resizes the image and calls the /alttexts REST endpoint
AlttextCapability Registers the alt text capability under the key alttext so the core task queue can dispatch jobs to it
AlttextController (Ajax) Manages the generation task lifecycle: create, poll status, review, and select a suggestion
FilelistController (Ajax) Lists files in a folder and saves approved alt texts back to sys_file_metadata
FolderController (Ajax) Lists sub-folders and bulk-accepts suggestions recursively
Ai3AlttextAddToBatch FormEngine AbstractNode that renders the batch button in the file metadata edit form
AfterFormEnginePageInitializedEventListener Loads the extension language labels whenever a FormEngine page is initialised

ZakAiAlttext API class 

Wegewerk\Ai3Alttext\Api\ZakAiAlttext implements Wegewerk\Ai3Core\Api\ZakAiEndpointInterface and exposes a single public method:

Classes/Api/ZakAiAlttext.php (signature)
public function generate(
    string $imagePath,
    string $caption,
    string $language
): string
Copied!

The method:

  1. Verifies the image file exists on disk.
  2. Resizes the image to a maximum of 512 × 512 px using ImageService and ImageProcessingService to keep API payload sizes small.
  3. Base64-encodes the resized image and POSTs it to the /alttexts endpoint via ZakAiClient::postJson().
  4. Returns the alttext string from the API response, or an empty string if the API reports an error.

Ajax routes 

All Ajax endpoints are registered in Configuration/Backend/AjaxRoutes.php:

Route identifier Target
ai3_alttext_generation_create_task AlttextController::addAlttextGenerationTaskAction
ai3_alttext_generation_review AlttextController::reviewAlttextAction
ai3_alttext_generation_select AlttextController::selectAlttextAction
ai3_alttext_generation_status AlttextController::checkAlttextGenerationStatusAction
ai3_filelist FilelistController::listFiles
ai3_filelist_save_file FilelistController::saveFile
ai3_filelist_create_task_alttext FilelistController::addAlttextTaskForFile
ai3_folders FolderController::listFolders
ai3_folders_acceptAll_recursive FolderController::acceptAllSuggestionsRecursive

Capability registration 

AlttextCapability is registered as a DI-tagged service so that the wegewerk/ai3_core capability registry picks it up automatically:

Configuration/Services.yaml
Wegewerk\Ai3Alttext\Domain\Capabilities\AlttextCapability:
    autowire: false
    arguments:
        $key: 'alttext'
        $title: 'Alt Text'
        $endpoint: '@Wegewerk\Ai3Alttext\Api\ZakAiAlttext'
    tags:
        - name: ai3.capability
Copied!

FormEngine field control 

The field control is registered as a custom FormEngine node in ext_localconf.php:

ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1759225979] = [
    'nodeName' => 'ai3AlttextAddToBatch',
    'priority' => 30,
    'class' => \Wegewerk\Ai3Alttext\FormEngine\FieldControl\Ai3AlttextAddToBatch::class,
];
Copied!

The TCA override in Configuration/TCA/Overrides/sys_file_metadata.php attaches this node to the alternative field of sys_file_metadata as a fieldControl.

Event listener 

AfterFormEnginePageInitializedEventListener listens to AfterFormEnginePageInitializedEvent and injects the extension language labels into the page renderer so that the JavaScript modules can use them via the TYPO3 inline label API.

Changelog 

0.9 — 2026-06-17 

  • Initial release by refactoring from the monolithic Ai3 extension into a dedicated wegewerk/ai3_alttext package