Skip to content

Instantly share code, notes, and snippets.

View xperseguers's full-sized avatar

Xavier Perseguers xperseguers

View GitHub Profile
@xperseguers
xperseguers / ext_tables.php
Last active April 26, 2024 19:33
Generic override XLIFF in TYPO3 CMS
<?php
/**
* Following snippet lets you easily override XLIFF-based localization files for any extension.
*
* Create localization files within your extension in:
*
* Resources/Private/Language/Overrides/<extension-key>.<original-name>.xlf
* Resources/Private/Language/Overrides/<locale>.<extension-key>.<original-name>.xlf
*
@xperseguers
xperseguers / README.md
Last active March 23, 2024 18:21
Create composer patch from a pending TYPO3 patch on Gerrit

Following structure is expected for your TYPO3 project (adapt script if it differs):

.
├── composer.json
├── composer.lock
├── patches
│   ├── ...
│   └── ...
└── scripts
@xperseguers
xperseguers / README.md
Last active December 22, 2023 09:52
Migrate from Pootle to Crowdin

Migrate your project from Pootle to Crowdin

Step 1: Choose extensions to migrate

I have a few extensions of mine on Pootle and I decided to migrate those:

  • cloudflare
  • direct_mail_userfunc
  • file_list
  • ig_ldap_sso_auth
@xperseguers
xperseguers / controller.php
Last active April 4, 2023 07:56
Upload files in TYPO3 from Frontend
/**
* Upload files.
*
* @return void
*/
public function uploadAction() {
$overwriteExistingFiles = TRUE;
$data = array();
$namespace = key($_FILES);
@xperseguers
xperseguers / flexform_myplugin.xml
Last active June 11, 2020 07:38
FlexForm for a Plugin with a repeatable section
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general</sheetTitle>
</TCEforms>
@xperseguers
xperseguers / MyCustomActionBackend.yaml
Last active May 19, 2020 15:41
Custom finisher for EXT:form in TYPO3 v8
# File EXT:your_ext/Configuration/Yaml/MyCustomActionBackend.yaml
TYPO3:
CMS:
Form:
prototypes:
# add our finisher to the 'standard' form prototype
standard:
formElementsDefinition:
Form:
formEditor:
@xperseguers
xperseguers / SingleRecordLocalizationMenu.php
Last active November 12, 2019 16:37
TypoScript-based language menu only showing available single news localizations
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
@xperseguers
xperseguers / ContextMenuActions.js
Last active October 31, 2019 17:44
Disable "delete" in TYPO3 context menu for pages under custom condition
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
@xperseguers
xperseguers / migration_helper.diff
Created February 22, 2017 10:54
TYPO3 TCA Migration helper
This patch was tested against TYPO3 v7.
Purpose is to *temporarily and quickly* let you export the migrated TCA to a file within typo3temp/migrated_TCA/<table_name>.migrated.php
so that you may then use any diff tool to compare the migrated TCA of a given table with your own definition.
To run it, just open backend module "Configuration -> TCA". This will automatically dump the whole (migrated) TCA to the disk.
This is not perfect but should help you a lot anyway to go through the various deprecation messages in typo3conf/deprecation_*.log.
Have fun!
@xperseguers
xperseguers / gist:b9e8cd0bc3bfdad13179
Last active May 2, 2019 08:14
Best practices for TYPO3 extension development with Git (or other VCS)

Versioning scheme

Stick to Semantic Versioning.

Releases

The official way of releasing TYPO3 extensions is to the TER, extensions existing solely as Git repositories are NOT properly made available to the community.