Skip to content

Instantly share code, notes, and snippets.

View einpraegsam's full-sized avatar
Ready to find solutions

Alexander Kellner einpraegsam

Ready to find solutions
View GitHub Profile
einpraegsam / Introduction.txt
Last active January 10, 2021 16:15
Auto-release new TYPO3 extensions from github to TER (TYPO3 Extension Repository) when they are tagged via REST API
View Introduction.txt
Github actions gives you the possibility to run some code after a special trigger (e.g. a push into a repo) is recognized.
This can be used for running tests or - in our case - to deploy the software to TYPO3 TER when a new tag is pushed.
1) First of all, you should login on and create some access token (API Token) to use the new REST API of
to publish your extensions (see for some more help on this).
2) After that you can add three secret tokens in your github repository
(see for some more details):
TYPO3_API_USERNAME (your username for FE-login on
TYPO3_API_PASSWORD (your password for FE-login on
einpraegsam / AdditionalConfiguration.php
Created December 17, 2020 08:50
CURL requests in TYPO3 with invalid SSL certificate
View AdditionalConfiguration.php
$GLOBALS['TYPO3_CONF_VARS']['HTTP']['verify'] = false;
einpraegsam / NotAuthorized.php
Last active May 10, 2023 21:46
Individual 403 and 404 handling in TYPO3 9 and 10. Show a 404 page but keep wrong URL. In case of a missing frontend login, redirect to login page and redirect back after login.
View NotAuthorized.php
namespace Vendor\Sitepackage\PageHandler;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Error\PageErrorHandler\PageErrorHandlerInterface;
use TYPO3\CMS\Core\Http\RedirectResponse;
use TYPO3\CMS\Core\Http\Uri;
use TYPO3\CMS\Core\Site\Entity\Site;
einpraegsam / SiteFactory.php
Last active June 10, 2022 13:42
What can you do with SiteConfiguration in TYPO3 and how to get a site object from anywhere?
View SiteFactory.php
namespace Vendor\Extension\Factory;
use GuzzleHttp\Psr7\Uri;
use TYPO3\CMS\Core\Exception\SiteNotFoundException;
use TYPO3\CMS\Core\Http\Request;
use TYPO3\CMS\Core\Http\ServerRequest;
use TYPO3\CMS\Core\Routing\SiteMatcher;
use TYPO3\CMS\Core\Site\Entity\Site;
einpraegsam / LanguageRedirect.php
Last active December 14, 2021 15:17
TYPO3: Simply redirect a visitor to secondary language if browser does not support default language using PSR-15 Middleware
View LanguageRedirect.php
namespace In2code\In2template\Middleware;
use CodeZero\BrowserLocale\BrowserLocale;
use CodeZero\BrowserLocale\Filters\LanguageFilter;
use In2code\In2template\Utility\ObjectUtility;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
einpraegsam / AbstractJsonLdSchemaViewHelper.php
Created April 11, 2020 17:39
JSON LD ViewHelpers to create information for Google & Co. out of pages or other records. Files in this examples in EXT:in2template/Classes/ViewHelpers/JsonLdSchema/
View AbstractJsonLdSchemaViewHelper.php
namespace In2code\In2template\ViewHelpers\JsonLdSchema;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
* Class AbstractJsonLdSchemaViewHelper
abstract class AbstractJsonLdSchemaViewHelper extends AbstractViewHelper
einpraegsam / MysqlXml.txt
Created October 2, 2019 07:25
MySQL: Read and write values from XML (e.g. TYPO3 FlexForm)
View MysqlXml.txt
# Read: Show real path in sys_file_storage
select name, uid, ExtractValue(configuration, '//T3FlexForms/data/sheet[@index="sDEF"]/language/field[@index="basePath"]/value') path from sys_file_storage where uid > 0
# Write: Set a new value (in this case a detail pid) in FlexForm of a tt_news plugin
UPDATE tt_content SET pi_flexform = UpdateXML(pi_flexform, '//T3FlexForms/data/sheet[@index="s_misc"]/language/field[@index="PIDitemDisplay"]/value', CONCAT('<value index="vDEF">', 123, '</value>' )) WHERE uid=11107
einpraegsam / 10Dinge.txt
Created September 27, 2019 07:26
10 Anzeichen dass du vielleicht zu viel für deine TYPO3 Extension bezahlt hast lieber Kunde...
View 10Dinge.txt
Hier findest du 10 Anzeichen dafür, dass du vielleicht zu viel für
deine TYPO3 Extension bezahlt hast lieber Kunde:
1. Das Icon der für dich entwickelten Extension ist das schwarz/graue TYPO3-Zeichen.
Datensätze in der Listenansicht haben komischerweise alle ein E-Symbol
und das obowhl die Extension gar nicht mit E anfängt.
2. Der Status der Extension steht schon seit über einem Jahr
auf 0.0.0 alpha.
einpraegsam / FlexformStudyfinderList.xml
Last active June 30, 2023 14:59
Overwrite a FlexForm from any Extension with your FlexForm in TYPO3
View FlexformStudyfinderList.xml
einpraegsam / GeneralUtility.php
Created February 6, 2019 12:30
Alternative GeneralUtility::xml2array() without 10MB restriction from libxml - for import and export . Quick and dirty hack, exactly like to the original one in TYPO3.
View GeneralUtility.php
namespace TYPO3\CMS\Core\Utility;
use GuzzleHttp\Exception\RequestException;
use TYPO3\CMS\Core\Core\ApplicationContext;
use TYPO3\CMS\Core\Core\ClassLoadingInformation;
use TYPO3\CMS\Core\Crypto\Random;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Http\RequestFactory;
use TYPO3\CMS\Core\Service\OpcodeCacheService;