TYPO3 Logo
TYPO3 Explained
Options
Give feedback View source How to edit Edit on GitHub Full documentation (single file)

TYPO3 Explained

  • Introduction
  • API A-Z
    • Assets
    • Authentication & Users
      • Backend Users
      • Frontend Users
      • Sessions
        • User session management
        • Session storage framework
      • Authentication services
        • CSRF-like request token handling
      • Password policies
      • Multi-factor authentication
    • Autoloading
      • ComposerClassLoader
    • Backend APIs
      • Access control
        • Users and groups
        • Password reset functionality
        • Roles
        • Options
        • Other Options
        • File mounts
        • Backend users module
      • Backend modules API
        • Modules.php
          • 3rd level
          • Toplevel
        • Backend GUI
        • DocHeaderComponent
        • ModuleData
        • ModuleInterface
        • ModuleProvider
        • ModuleTemplate
        • ModuleTemplateFactory
        • TypoScript
        • Sudo mode
      • JavaScript
        • ES6 in the TYPO3 Backend
        • Client-side templating
        • Various JavaScript modules
          • Modals
          • Multi-step wizard
          • DocumentService (jQuery.ready substitute)
          • SessionStorage wrapper
        • Ajax request
        • Event API
        • Hotkey API
        • Navigation via JavaScript
        • JavaScript form helpers
      • Ajax
      • Backend layout
      • Backend routing
      • Backend user object
      • Broadcast channels
      • Button components
      • Clipboard
      • Context menus
      • Custom Permissions
      • LoginProvider
      • Page tree
      • UriBuilder
    • Bitsets
    • Caching
      • Quick start for integrators
      • Configuration
      • Caching framework architecture
      • Cache frontends
      • Developer information
    • System categories
    • Code editor
    • Commands
      • List Core commands
      • Tutorial
    • Content Elements & Plugins
      • Create a custom content element type
      • Custom data processors
      • Create plugins
      • Configure custom backend preview for content element
      • New content element wizard
      • Best practices
      • Migration: list_type plugins to CType
    • Content Security Policy
    • Context API and aspects
    • Country API
    • Cropping images
      • General Configuration
      • Crop variants configuration per content element
    • Database
      • Tables
      • Records
        • Record objects
      • DBAL
        • Introduction
        • Configuration
        • Basic create, read, update, and delete operations (CRUD)
        • Class overview
        • ConnectionPool
        • Query builder
        • Connection
        • Expression builder
        • Restriction builder
        • Result
        • Driver middlewares
        • Various tips and tricks
        • Troubleshooting
      • Database compare
      • Extbase persistence
    • DataHandler
      • Introduction
      • DataHandler basics
      • Using the DataHandler in scripts
      • The "/record/commit" route
    • Debugging
    • Dependency injection
    • Deprecation
    • Environment
    • Error and exception handling
      • Configuration
      • Error Handler
      • Production exception handler
      • Debug exception handler
      • Examples
      • How to extend the error and exception handling
    • Events and hooks
      • Extending the TYPO3 Core
      • Event dispatcher (PSR-14 events)
      • Event list
        • Backend
          • AfterBackendPageRenderEvent
          • AfterFormEnginePageInitializedEvent
          • AfterHistoryRollbackFinishedEvent
          • AfterPageColumnsSelectedForLocalizationEvent
          • AfterPagePreviewUriGeneratedEvent
          • AfterPageTreeItemsPreparedEvent
          • AfterRawPageRowPreparedEvent
          • AfterRecordSummaryForLocalizationEvent
          • BeforeFormEnginePageInitializedEvent
          • BeforeHistoryRollbackStartEvent
          • BeforeLiveSearchFormIsBuiltEvent
          • BeforeModuleCreationEvent
          • BeforePagePreviewUriGeneratedEvent
          • BeforePageTreeIsFilteredEvent
          • BeforeRecordDownloadIsExecutedEvent
          • BeforeRecordDownloadPresetsAreDisplayedEvent
          • BeforeSearchInDatabaseRecordProviderEvent
          • CustomFileControlsEvent
          • IsContentUsedOnPageLayoutEvent
          • IsFileSelectableEvent
          • ModifyAllowedItemsEvent
          • ModifyButtonBarEvent
          • ModifyClearCacheActionsEvent
          • ModifyDatabaseQueryForContentEvent
          • ModifyDatabaseQueryForRecordListingEvent
          • ModifyEditFormUserAccessEvent
          • ModifyFileReferenceControlsEvent
          • ModifyFileReferenceEnabledControlsEvent
          • ModifyGenericBackendMessagesEvent
          • ModifyImageManipulationPreviewUrlEvent
          • ModifyInlineElementControlsEvent
          • ModifyInlineElementEnabledControlsEvent
          • ModifyLinkExplanationEvent
          • ModifyLinkHandlersEvent
          • ModifyNewContentElementWizardItemsEvent
          • ModifyPageLayoutContentEvent
          • ModifyPageLayoutOnLoginProviderSelectionEvent
          • ModifyQueryForLiveSearchEvent
          • ModifyRecordListHeaderColumnsEvent
          • ModifyRecordListRecordActionsEvent
          • ModifyRecordListTableActionsEvent
          • ModifyResultItemInLiveSearchEvent
          • PageContentPreviewRenderingEvent
          • PasswordHasBeenResetEvent
          • RenderAdditionalContentToRecordListEvent
          • SwitchUserEvent
          • SystemInformationToolbarCollectorEvent
        • Core
          • Authentication
            • AfterGroupsResolvedEvent
            • AfterUserLoggedInEvent
            • AfterUserLoggedOutEvent
            • BeforeRequestTokenProcessedEvent
            • BeforeUserLogoutEvent
            • LoginAttemptFailedEvent
          • Cache
            • CacheFlushEvent
            • CacheWarmupEvent
          • Configuration
            • AfterFlexFormDataStructureIdentifierInitializedEvent
            • AfterFlexFormDataStructureParsedEvent
            • AfterTcaCompilationEvent
            • BeforeFlexFormDataStructureIdentifierInitializedEvent
            • BeforeFlexFormDataStructureParsedEvent
            • BeforeTcaOverridesEvent
            • ModifyLoadedPageTsConfigEvent
            • SiteConfigurationBeforeWriteEvent
            • SiteConfigurationLoadedEvent
          • Core
            • BootCompletedEvent
          • Country
            • BeforeCountriesEvaluatedEvent
          • Database
            • AlterTableDefinitionStatementsEvent
          • DataHandling
            • AppendLinkHandlerElementsEvent
            • IsTableExcludedFromReferenceIndexEvent
          • Domain
            • AfterRecordLanguageOverlayEvent
            • BeforePageIsRetrievedEvent
            • BeforePageLanguageOverlayEvent
            • BeforeRecordLanguageOverlayEvent
            • ModifyDefaultConstraintsForDatabaseQueryEvent
            • RecordAccessGrantedEvent
            • RecordCreationEvent
          • Html
            • AfterTransformTextForPersistenceEvent
            • AfterTransformTextForRichTextEditorEvent
            • BeforeTransformTextForPersistenceEvent
            • BeforeTransformTextForRichTextEditorEvent
            • BrokenLinkAnalysisEvent
          • Imaging
            • ModifyRecordOverlayIconIdentifierEvent
          • Link handling
            • AfterLinkResolvedByStringRepresentationEvent
            • AfterTypoLinkDecodedEvent
            • BeforeTypoLinkEncodedEvent
          • Mail
            • AfterMailerSentMessageEvent
            • BeforeMailerSentMessageEvent
          • Package
            • AfterPackageActivationEvent
            • AfterPackageDeactivationEvent
            • BeforePackageActivationEvent
            • PackageInitializationEvent
            • PackagesMayHaveChangedEvent
          • Page
            • BeforeJavaScriptsRenderingEvent
            • BeforeStylesheetsRenderingEvent
          • Password policy
            • EnrichPasswordValidationContextDataEvent
          • Resource
            • AfterDefaultUploadFolderWasResolvedEvent
            • AfterFileAddedEvent
            • AfterFileAddedToIndexEvent
            • AfterFileCommandProcessedEvent
            • AfterFileContentsSetEvent
            • AfterFileCopiedEvent
            • AfterFileCreatedEvent
            • AfterFileDeletedEvent
            • AfterFileMarkedAsMissingEvent
            • AfterFileMetaDataCreatedEvent
            • AfterFileMetaDataDeletedEvent
            • AfterFileMetaDataUpdatedEvent
            • AfterFileMovedEvent
            • AfterFileProcessingEvent
            • AfterFileRemovedFromIndexEvent
            • AfterFileRenamedEvent
            • AfterFileReplacedEvent
            • AfterFileUpdatedInIndexEvent
            • AfterFolderAddedEvent
            • AfterFolderCopiedEvent
            • AfterFolderDeletedEvent
            • AfterFolderMovedEvent
            • AfterFolderRenamedEvent
            • AfterResourceStorageInitializationEvent
            • AfterVideoPreviewFetchedEvent
            • BeforeFileAddedEvent
            • BeforeFileContentsSetEvent
            • BeforeFileCopiedEvent
            • BeforeFileCreatedEvent
            • BeforeFileDeletedEvent
            • BeforeFileMovedEvent
            • BeforeFileProcessingEvent
            • BeforeFileRenamedEvent
            • BeforeFileReplacedEvent
            • BeforeFolderAddedEvent
            • BeforeFolderCopiedEvent
            • BeforeFolderDeletedEvent
            • BeforeFolderMovedEvent
            • BeforeFolderRenamedEvent
            • BeforeResourceStorageInitializationEvent
            • EnrichFileMetaDataEvent
            • GeneratePublicUrlForResourceEvent
            • ModifyFileDumpEvent
            • ModifyIconForResourcePropertiesEvent
            • SanitizeFileNameEvent
          • Security
            • InvestigateMutationsEvent
            • PolicyMutatedEvent
          • Tree
            • ModifyTreeDataEvent
          • TypoScript
            • AfterTemplatesHaveBeenDeterminedEvent
            • BeforeLoadedPageTsConfigEvent
            • BeforeLoadedUserTsConfigEvent
            • EvaluateModifierFunctionEvent
        • Extbase
          • Configuration
            • BeforeFlexFormConfigurationOverrideEvent
          • Mvc
            • AfterRequestDispatchedEvent
            • BeforeActionCallEvent
          • Persistence
            • AfterObjectThawedEvent
            • EntityAddedToPersistenceEvent
            • EntityPersistedEvent
            • EntityRemovedFromPersistenceEvent
            • EntityUpdatedInPersistenceEvent
            • ModifyQueryBeforeFetchingObjectDataEvent
            • ModifyResultAfterFetchingObjectDataEvent
        • ExtensionManager
          • AfterExtensionDatabaseContentHasBeenImportedEvent
          • AfterExtensionFilesHaveBeenImportedEvent
          • AfterExtensionStaticDatabaseContentHasBeenImportedEvent
          • AvailableActionsForExtensionEvent
        • Filelist
          • ModifyEditFileFormDataEvent
          • ProcessFileListActionsEvent
        • Form
          • AfterFormDefinitionLoadedEvent
        • Frontend
          • AfterCacheableContentIsGeneratedEvent
          • AfterCachedPageIsPersistedEvent
          • AfterContentHasBeenFetchedEvent
          • AfterContentObjectRendererInitializedEvent
          • AfterGetDataResolvedEvent
          • AfterImageResourceResolvedEvent
          • AfterLinkIsGeneratedEvent
          • AfterPageAndLanguageIsResolvedEvent
          • AfterPageWithRootLineIsResolvedEvent
          • AfterStdWrapFunctionsExecutedEvent
          • AfterStdWrapFunctionsInitializedEvent
          • AfterTypoScriptDeterminedEvent
          • BeforePageCacheIdentifierIsHashedEvent
          • BeforePageIsResolvedEvent
          • BeforeStdWrapContentStoredInCacheEvent
          • BeforeStdWrapFunctionsExecutedEvent
          • BeforeStdWrapFunctionsInitializedEvent
          • EnhanceStdWrapEvent
          • FilterMenuItemsEvent
          • ModifyCacheLifetimeForPageEvent
          • ModifyHrefLangTagsEvent
          • ModifyImageSourceCollectionEvent
          • ModifyPageLinkConfigurationEvent
          • ModifyRecordsAfterFetchingContentEvent
          • ModifyResolvedFrontendGroupsEvent
          • ModifyTypoScriptConfigEvent
          • ShouldUseCachedPageDataIfAvailableEvent
        • FrontendLogin
          • BeforeRedirectEvent
          • LoginConfirmedEvent
          • LoginErrorOccurredEvent
          • LogoutConfirmedEvent
          • ModifyLoginFormViewEvent
          • ModifyRedirectUrlValidationResultEvent
          • PasswordChangeEvent
          • SendRecoveryEmailEvent
        • Impexp
          • BeforeImportEvent
        • Indexed search
          • BeforeFinalSearchQueryIsExecutedEvent
        • Info
          • ModifyInfoModuleContentEvent
        • Install
          • ModifyLanguagePackRemoteBaseUrlEvent
          • ModifyLanguagePacksEvent
        • Linkvalidator
          • BeforeRecordIsAnalyzedEvent
          • ModifyValidatorTaskEmailEvent
        • Lowlevel
          • ModifyBlindedConfigurationOptionsEvent
        • Redirects
          • AfterAutoCreateRedirectHasBeenPersistedEvent
          • AfterPageUrlsForSiteForRedirectIntegrityHaveBeenCollectedEvent
          • BeforeRedirectMatchDomainEvent
          • ModifyAutoCreateRedirectRecordBeforePersistingEvent
          • ModifyRedirectManagementControllerViewDataEvent
          • RedirectWasHitEvent
          • SlugRedirectChangeItemCreatedEvent
        • Seo
          • ModifyUrlForCanonicalTagEvent
        • Setup
          • AddJavaScriptModulesEvent
        • Workspaces
          • AfterCompiledCacheableDataForWorkspaceEvent
          • AfterDataGeneratedForWorkspaceEvent
          • AfterRecordPublishedEvent
          • GetVersionedDataEvent
          • ModifyVersionDifferencesEvent
          • SortVersionedDataEvent
      • Hooks
      • JavaScript Event API
        • Regular event
        • Debounce event
        • Throttle event
        • RequestAnimationFrame event
    • File abstraction
      • Basic concepts
      • Architecture
        • Overview
        • Folders
        • Database structure
        • Components
        • PSR-14 events
      • Administration
        • Permissions
        • File storages
        • Maintenance
      • Using FAL
        • Using FAL in the frontend
        • TCA definition
        • The StorageRepository class
        • Working with files, folders and file references
        • Working with collections
        • Searching for files
      • File collections
    • Feature toggle API
    • Custom file processors
    • Flash messages
      • Flash messages API
      • Flash messages in Extbase
      • Flash messages renderer
      • JavaScript-based flash messages (Notification API)
    • FlexForms
      • T3DataStructure
        • Elements
        • Sheet References
        • Parsing a Data Structure
    • Fluid
      • ViewHelper reference
      • Introduction to Fluid
      • Fluid syntax
      • Using Fluid in TYPO3
      • cObject ViewHelper
      • Property additionalAttributes
      • Developing a custom ViewHelper
    • FormEngine
      • Introduction
      • Main rendering workflow
      • Data compiling
      • Rendering
    • Form protection tool
    • Global values
      • Constants
    • Icon API
    • Link handling
      • Link handler configuration
      • LinkBrowser API
      • The LinkHandler API
        • The PageLinkHandler
        • The RecordLinkHandler
        • Implementing a custom LinkHandler
        • Events to modify link handler
      • Core link handler
      • Frontend link builder
      • LinkBrowser Tutorials
        • Browse records of a table
        • Create a custom link browser
    • Localization
      • Introduction
      • Supported languages
      • Managing translations
      • Translation servers
        • Localization with Crowdin
          • Extension integration
          • Online translation with Crowdin
          • Workflow
          • Frequently asked questions (FAQ)
        • Custom translation servers
      • Localization API
        • LanguageService
        • LanguageServiceFactory
        • Locale
        • LocalizationUtility (Extbase)
      • XLIFF Format
      • Working with XLIFF files
    • Locking API
    • Logging
      • Quickstart
      • Logger
      • Configuration of the logging system
      • The LogRecord model
      • Log writers
      • Log processors
    • Mail API
    • Message bus
    • Mount points
    • Namespaces
    • Page types
      • Types of pages
      • Redirect Headers
      • Create new Page Type
    • Pagination
    • Parsing HTML
    • Password hashing
      • Troubleshooting
    • Requests
      • Bootstrapping
      • Middlewares (Request handling)
      • TYPO3 request object
      • TYPO3 request attributes
        • Application type
        • Current content object
        • Frontend cache collector
        • Frontend cache instruction
        • Frontend controller
        • Frontend page information
        • Frontend TypoScript
        • Frontend user
        • Language
        • Module
        • ModuleData
        • Nonce
        • Normalized parameters
        • Route
        • Routing
        • Site
        • Target
    • Routing
      • Introduction
      • Page-based Routing
      • For extensions
      • Extending
      • Examples
    • RTE
      • Rendering
      • Backend
        • Plugging in a custom RTE
      • RTE in frontend forms
      • RTE Transformations
        • Introduction
        • Transformation overview
      • Historical Perspective on RTE Transformations
        • Properties and Transformations
        • RTE Transformations in Content Elements
    • SEO
      • General Recommendations
      • Configuration
      • Canonical API
      • MetaTag API
      • Page title API
      • XML sitemap
    • Services
      • Introduction
      • Using Services
        • Service precedence
        • Simple usage
        • Use with subtypes
        • Calling a chain of services
      • Configuration
        • Override service registration
        • Service configuration
        • Service type configuration
      • Developer's Guide
        • Introducing a new service type
        • Implementing a service
        • Service API
        • Services API
    • Site handling
      • Basics
      • Creation
      • Base variants
      • Adding Languages
      • Error handling
        • Page-based error handler
        • Fluid-based error handler
      • Writing a custom page error handler
      • Static routes
      • Environment variables
      • Usage in TypoScript + Fluid
      • Usage
      • Usage in TCA
      • Site sets
      • Site settings
      • Site settings definitions
      • Site settings editor
      • Console tools
      • PHP API
      • Extended configuration
    • Soft references
    • Symfony expression language
    • System registry
    • TSFE
    • TYPO3 information
    • Webhooks and reactions
    • Versioning and Workspaces
    • XCLASSes
    • YAML API
      • Syntax
  • Administration
    • Installation
      • Classic mode
        • ZIP/Tarball
        • Wget and Symlinks
        • Windows servers
        • Installation wizard
        • Release integrity
      • Composer-based Installation
      • Server installations
        • Composer on the server
      • System Requirements
    • Deployment
      • Configuring environments
      • Tools
        • Rsync
        • Deployer
      • CI/CD Automation
    • Directory structure
      • Classic mode installation
      • Flag files
      • Site folder
    • Version Control (Git)
    • Upgrades
      • Patch/Bugfix update
      • Major upgrade
        • Pre-upgrade tasks
        • Upgrade the Core
        • Post-upgrade tasks
      • Upgrading extensions
      • Third-party tools
      • Classic mode upgrade
      • Applying Core patches
      • Migrate a TYPO3 project to Composer
        • Requirements
        • Migration steps
        • Migrating public web assets
        • Version control
      • Migrate content
    • System Settings
      • Application Context
      • Backend entry point
      • Maintenance Mode
      • Production Settings
    • Backend users
      • Backend Users module
      • Adding backend users
      • Administrators
      • Groups
        • Permission details
      • Page permissions
      • Language
    • Tuning
    • Troubleshooting
      • TYPO3
      • System Modules
      • PHP
      • Web Server
      • Database
    • Extension management
      • Installing Extensions - Classic mode
    • Permissions
      • General recommendations
      • Setting up backend user groups
      • Example configuration of backend user groups
      • Permissions synchronization
      • Groups inheritance
  • Settings & Config
    • Overview
    • Configuration module
    • $GLOBALS
    • System configuration
      • BE - backend configuration
      • DB - Database connections
      • EXT - Extension manager configuration
      • FE - frontend configuration
      • GFX - graphics configuration
      • HTTP - tune requests
      • LOG - Logging configuration
      • MAIL settings
      • SYS - System configuration
    • TypoScript
      • Introduction
      • Syntax
      • Frontend TypoScript
      • TSconfig
      • PHP API
      • Myths and FAQ
    • User settings configuration
      • ['columns'] Section
      • ['showitem'] section
      • Extending the user settings
      • View the configuration
  • Coding guidelines
    • Introduction
    • PHP
      • General requirements for PHP files
      • File structure
      • PHP syntax formatting
      • Using phpDoc
    • JavaScript
    • TypeScript
    • TypoScript
    • TSconfig
    • XLIFF
    • YAML
    • reStructuredText
  • Extension development
    • Concepts
      • Introduction
      • System, third-party and custom extensions
      • Further reading
    • File structure
      • Classes
      • Configuration
        • Backend
        • Extbase
          • Persistence
        • Sets
        • TCA
        • TsConfig
        • TypoScript
        • ContentSecurityPolicies.php
        • Icons.php
        • page.tsconfig
        • RequestMiddlewares.php
        • Services.yaml
        • user.tsconfig
      • Documentation
      • Resources
        • Private
          • Language
        • Public
      • Tests
      • composer.json
      • ext_conf_template.txt
      • ext_emconf.php
      • ext_localconf.php
      • ext_tables.php
      • ext_tables.sql
      • ext_tables_static+adt.sql
      • ext_typoscript_constants.typoscript
      • ext_typoscript_setup.typoscript
    • Site package
      • Introduction
    • Howto
      • Backend modules
        • Modules.php
        • Plain controller
        • Extbase controller
        • Security Considerations
        • Tutorials
      • Events
      • Extending an Extbase model
      • Extending the TCA array
        • Storing the changes
        • Customization Examples
        • Verifying the TCA
      • Frontend plugin
      • Localization
        • Multi-language Fluid templates
        • Localization in PHP
        • TypoScript
      • Publish your extension
        • Publish your extension in the TER
      • HTTP requests to external sources
      • Update your extension for new TYPO3 versions
        • Extension scanner
        • Upgrade wizards
          • The concept of upgrade wizards
          • Creating upgrade wizards
          • Examples for common upgrade wizards
      • Configuration
      • Creating a new distribution
      • Creating a new extension
      • Custom Extension Repository
      • Adding documentation
    • Extbase
      • Introduction
      • Reference
        • Domain
          • Model
            • Property types
            • Persistence
            • Relations
            • Hydrating
            • Localization
          • Repository
        • Controller
          • ActionController
          • Error action
          • Property mapping
          • Type converters
        • View
        • URI builder
        • Registration of frontend plugins
        • TypoScript configuration
        • Annotations
        • Validation
          • Custom Validator
          • List of Validators
        • File upload
        • Caching
        • Localization
        • URI arguments
      • Examples
    • Best practises and conventions
      • Choosing an extension key
      • Naming conventions
      • Configuration Files (ext_tables.php & ext_localconf.php)
      • Software Design Principles
      • Extension loading order
    • Tutorials
      • Kickstart
        • Make
          • Create a new backend controller
          • Create a new console command
      • Tea
        • Create an extension
        • Create a directory structure
        • Model: a bag of tea
        • Repository
        • Controller
      • Components of a TYPO3 extension
        • Making the extension installable
        • Creating a new database model
        • Making data persistable by Extbase
      • Extbase
  • PHP architecture
    • Named arguments
    • Services
    • Static Methods, static Classes, Utility Classes
    • Traits
    • Working with exceptions
    • Singletons
    • About readonly
  • Security guidelines
    • Introduction
    • The TYPO3 Security Team
    • General Information
    • Types of Security Threats
    • General guidelines
    • Guidelines for System Administrators
      • Role Definition
      • Integrity of TYPO3 Packages
      • File/directory permissions
      • Restrict access to files on a server-level
      • Disable directory indexing
      • File extension handling
      • Content security policy
      • Database access
      • Encrypted Client/server Communication
      • Other Services
      • Further Actions
    • Guidelines for extension development
    • Guidelines for TYPO3 integrators
      • Install tool
      • Global TYPO3 configuration options
      • Security-related warnings after login
      • Reports and logs
      • Users and access privileges
      • TYPO3 extensions
      • TypoScript
      • Content elements
    • Guidelines for editors
    • Backup strategy
    • Detect, analyze and repair a hacked site
      • Detect a hacked website
      • Take the website offline
      • Analyzing a hacked site
      • Repair/restore
      • Further actions
  • Testing
    • Extension testing
    • Project testing
    • Unit tests
      • Introduction
      • Running
    • Functional tests
      • Introduction
    • Acceptance tests
    • Test Runners
    • Testing tutorials
      • Testing enetcache
      • Acceptance testing of site_introduction
  • About This Manual
  • Sitemap
  1. TYPO3 Explained
  2. API A-Z
  3. Backend APIs
  4. UriBuilder
Give feedback Edit on GitHub

Use the backend UriBuilder to link to "Edit Records"

It is often needed to create links to edit records in the TYPO3 backend. The same syntax is also used for creating new records. TYPO3 provides an API for creating such links, namely \TYPO3\CMS\Backend\Routing\UriBuilder.

Hint

Make sure to use \TYPO3\CMS\Backend\Routing\UriBuilder to create backend links and not \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder.

The variable available as $this->uriBuilder in a controller is the web routing UriBuilder and can only be used for frontend links.

When using Fluid templates the URI either has to be created via PHP in the controller or a ViewHelper to be used.

Display a link to "Edit Record"

The Uri.editRecord ViewHelper <be:uri.editRecord> can be used to create a "create new record" link:

EXT:my_extension/Resources/Private/Partials/BackendModule/EditRecordLink.html
{namespace be=TYPO3\CMS\Backend\ViewHelpers\}
{namespace core=TYPO3\CMS\Core\ViewHelpers\}
<a href="{be:uri.editRecord(uid:2, table:'pages', returnUrl:'foo/bar')}">
    <core:icon identifier="actions-document-open"/>
    Edit Page 2
</a>
Copied!

If you create the backend link via PHP it is possible to add more options like default values for certain fields.

EXT:my_extension/Classes/Controller.php
<?php

namespace MyVendor\MyExtension\Controller;

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\UriInterface;
use TYPO3\CMS\Backend\Routing\UriBuilder;
use TYPO3\CMS\Backend\Template\ModuleTemplate;
use TYPO3\CMS\Backend\Template\ModuleTemplateFactory;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

class ModuleController extends ActionController
{
    public function __construct(
        protected readonly ModuleTemplateFactory $moduleTemplateFactory,
        private readonly UriBuilder $backendUriBuilder,
    ) {}

    protected function getEditLink(): UriInterface
    {
        $uriParameters = [
            'edit' =>
                [
                    'pages' => [1 => 'edit'],
                ],
        ];
        return $this->backendUriBuilder
            ->buildUriFromRoute('record_edit', $uriParameters);
    }

    public function linksAction(): ResponseInterface
    {
        $backendView = $this->initializeModuleTemplate($this->request);
        $editPage1Link = $this->getEditLink();
        $backendView->assignMultiple(
            [
                'editPage1Link' => $editPage1Link,
            ],
        );
        return $backendView->renderResponse('ShowPost');
    }
    protected function initializeModuleTemplate(
        ServerRequestInterface $request,
    ): ModuleTemplate {
        $view = $this->moduleTemplateFactory->create($request);

        // ...

        return $view;
    }
}
Copied!

Examples of "Edit record" links

The example extension t3docs/examples contains extended examples of different types of edit/create record links in the backend.

Here an excerpt:

Class T3docs\Examples\Controller\ModuleController
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
use Psr\Log\LoggerInterface;
use T3docs\Examples\Service\TableInformationService;
use TYPO3\CMS\Backend\Routing\UriBuilder;
use TYPO3\CMS\Backend\Template\ModuleTemplateFactory;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Resource\FileRepository;
use TYPO3\CMS\Core\Resource\ResourceFactory;

class ModuleController extends ActionController
{
    public function linksAction(): ResponseInterface
    {
        $pageUid = (int)($this->request->getQueryParams()['id'] ?? 0);
        $returnUrl = (string)$this->backendUriBuilder->buildUriFromRoute(
            'web_examples',
            ['id' => $pageUid, 'action' => 'links'],
        );

        $editPage1Link = $this->getEditPageLink(1, $returnUrl);
        $editPagesDoktypeLink = $this->getEditDoktypeLink($returnUrl);
        $createHaikuLink = $this->getCreateHaikuLink($returnUrl);

        $view = $this->initializeModuleTemplate($this->request);
        $view->assignMultiple(
            [
                'editPage1Link' => $editPage1Link,
                'editPagesDoktypeLink' => $editPagesDoktypeLink,
                'createHaikuLink' => $createHaikuLink,
                'returnUrl' => $returnUrl,
            ],
        );
        return $view->renderResponse();
    }

    private function getEditPageLink(int $uid, string $returnUrl): UriInterface
    {
        $uriParameters = [
            'edit' => [
                'pages' => [
                    $uid => 'edit',
                ],
            ],
            'returnUrl' => $returnUrl,
        ];
        return $this->backendUriBuilder->buildUriFromRoute(
            'record_edit',
            $uriParameters,
        );
    }

    public function __construct(
        protected readonly ModuleTemplateFactory $moduleTemplateFactory,
        protected readonly IconFactory $iconFactory,
        protected readonly ExtensionConfiguration $extensionConfiguration,
        protected readonly PasswordHashFactory $passwordHashFactory,
        protected readonly ResourceFactory $resourceFactory,
        protected readonly FileRepository $fileRepository,
        protected readonly ConnectionPool $connectionPool,
        protected readonly TableInformationService $tableInformationService,
        protected readonly LoggerInterface $logger,
        protected readonly UriBuilder $backendUriBuilder,
    ) {}
}
Copied!

The links appear in the example backend module:

The two links in the Examples module

The examples above leads to the normal edit form for a page:

Page 1 ready for editing with the standard form

Additional options for editing records

When creating the link via PHP it is possible to add more options.

You can specify as many tables and UIDs as needed and you will get them all in one single form! (short way of editing more records from the same table at once).

Also the fields to be displayed can be restricted.

Class T3docs\Examples\Controller\ModuleController
use Psr\Http\Message\UriInterface;

class ModuleController extends ActionController
{
    protected function getEditDoktypeLink(string $returnUrl): UriInterface
    {
        $uriParameters =
            [
                'edit' => [
                    'pages' => [
                        1 => 'edit',
                        2 => 'edit',
                    ],
                    'tx_examples_haiku' => [
                        1 => 'edit',
                    ],
                ],
                'columnsOnly' => [
                    'pages' => [
                        'title',
                        'doktype',
                    ],
                ],
                'returnUrl' => $returnUrl,
            ];
        return $this->backendUriBuilder->buildUriFromRoute(
            'record_edit',
            $uriParameters,
        );
    }
}
Copied!

Changed in version 14.0

Accepting a comma-separated list of fields as value for columnsOnly has been removed. See Migration: Table dependant definition of columnsOnly.

The fields to be included can be listed in the columnsOnly parameter, as a comma-separated list. The order of the fields doesn't matter, they get displayed in the order they appear in the TCA. If a field is missing or access restricted in one of the tables it just doesn't appear. However if one record to be edited is missing none of the records gets displayed.

The example above results in the following:

Editing of fields of two pages and one haiku at once

Display a link to "Create a New Record"

The Uri.newRecord ViewHelper <be:uri.newRecord> can be used to create a "create new record" link:

EXT:examples/Resources/Private/Partials/Module/CreateHaikuBlankLink.html
<html data-namespace-typo3-fluid="true"
      xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
      xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
      xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
>
   <a href="{be:uri.newRecord(pid:1, table:'tx_examples_haiku', returnUrl:returnUrl)}">
      <core:icon identifier="actions-document-new"/>
      <f:translate key="function_links_new_haiku"/>
   </a>
</html>
Copied!

If you create the backend link via PHP it is possible to add more options like default values for certain fields.

Class T3docs\Examples\Controller\ModuleController
use Psr\Http\Message\UriInterface;

class ModuleController extends ActionController
{
    protected function getCreateHaikuLink(string $returnUrl): UriInterface
    {
        $uriParameters =
            [
                'edit' => [
                    'tx_examples_haiku' => [
                        1 => 'new',
                    ],
                ],
                'defVals' => [
                    'tx_examples_haiku' => [
                        'title' => 'New Haiku?',
                        'season' => 'Spring',
                    ],
                ],
                'columnsOnly' => [
                    'tx_examples_haiku' => [
                        'title',
                        'season',
                        'color',
                    ],
                ],
                'returnUrl' => $returnUrl,
            ];
        return $this->backendUriBuilder->buildUriFromRoute(
            'record_edit',
            $uriParameters,
        );
    }
}
Copied!

Changed in version 14.0

Accepting a comma-separated list of fields as value for columnsOnly has been removed. See Migration: Table dependant definition of columnsOnly.

It can then be displayed like this:

EXT:examples/Resources/Private/Partials/Module/CreateHaikuLink.html
<html data-namespace-typo3-fluid="true"
      xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
      xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
>
   <a href="{createHaikuLink}">
      <core:icon identifier="actions-document-new"/>
      <f:translate key="function_links_new_spring_haiku"/>
   </a>
</html>
Copied!

The link triggers the creation a new record for the table tx_examples_haiku on page 1. It also sets a default value for the title field ("New haiku") and selects the season "Spring". It only displays the fields defined by columnsOnly.

Note the following things:

  • the first parameter is called "edit" even if this is about creating a new record. The creation of a record is indicated by the value "new".
  • the key of the entry with value "new" indicates the pid on which the record is to be created.
  • the values get automatically url-encoded so you can use any special char in the defaults

This results in the following new record form with a pre-filled title and season field.

Form for creating a new haiku with pre-filled title and season and restricted columns

  • Previous
  • Next
Reference to the headline

Copy and freely share the link

This link target has no permanent anchor assigned. You can make a pull request on GitHub to suggest an anchor. The link below can be used, but is prone to change if the page gets moved.

Copy this link into your TYPO3 manual.

  • Home
  • Contact
  • Issues
  • Repository

Last rendered: May 15, 2025 13:42

© since 2012 by the TYPO3 contributors
  • Legal Notice
  • Privacy Policy