Skip to content

Instantly share code, notes, and snippets.

View MarkusGehrig's full-sized avatar
👨‍💻

Markus Gehrig MarkusGehrig

👨‍💻
  • Gerichte Kanton Aargau
  • Buchs AG, Switzerland
View GitHub Profile
@MarkusGehrig
MarkusGehrig / MyCustomActionBackend.yaml
Created December 5, 2019 08:33 — forked from xperseguers/MyCustomActionBackend.yaml
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:
@MarkusGehrig
MarkusGehrig / delete_merged.sh
Created May 7, 2019 07:50 — forked from ribase/delete_merged.sh
this bash command will remove all merged branches
git branch --format="%(refname:lstrip=2)" --merged | xargs git branch -d
@MarkusGehrig
MarkusGehrig / script.php
Created November 28, 2018 13:33
get parameters from google analytics csv
<?php
//MIT License
//Copyright (c) 2018 Markus Gehrig
//
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
@MarkusGehrig
MarkusGehrig / TYPO376_Activate_Old_Language_Handling.typoscript
Created November 22, 2018 08:55
Activates the old translation handling from TYPO3 6.2 in TYPO3 7.6+
# By default, TYPO3 will not allow you to mix translated content and independent content in the page module. Content elements violating this behavior will be marked in the Page Module and there is no UI control allowing you to create independent content elements in a given language.
# If you want to go back to the old, inconsistent behavior, you can toggle it back on via this switch.
# PageTS:
mod.web_layout.allowInconsistentLanguageHandling = 1
# The system will report an error if the requested translation does not exist. Basically this means that all pages with gray background in the Web > Info / Localization overview module will fail (they would otherwise fall back to default language in one way or another).
# TypoScript Setup:
config.sys_language_mode = strict
# TypoScript Setup:
@MarkusGehrig
MarkusGehrig / TCASelectItems_performance_increase_IRRE.patch
Created November 15, 2018 08:46
TYPO3 8.7 IRRE Performance Increase
Index: cms/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- cms/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php (revision )
+++ cms/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php (revision )
@@ -43,6 +43,11 @@
continue;
}
<?php
// Every line in this strin is a new key
$stringKey = "1. Key
2. Key
";
// Explode the string to a array. Separate by EOL (enf of line)
$stringKeyArray = explode(PHP_EOL, $stringKey);
@MarkusGehrig
MarkusGehrig / setup.typoscript
Created September 27, 2018 13:18
TYPO3 HREFLANG for Google
# HREFLANG Tag for Google
tmp.hreflang = HMENU
tmp.hreflang {
special = language
special.value = 0, 1, 2
special.normalWhenNoLanguage = 0
1 = TMENU
1 {
NO = 1
NO {
@MarkusGehrig
MarkusGehrig / mysql.sql
Created September 4, 2018 07:47
TYPO3 MySQL: InnerJoin SysCategory from default record uid
SELECT sys_category_translated.title FROM sys_category AS sys_category_translated
INNER JOIN sys_category AS sys_category ON (sys_category_translated.uid = sys_category.uid OR sys_category_translated.l10n_parent = sys_category.uid)
INNER JOIN sys_category_record_mm ON sys_category.uid = sys_category_record_mm.uid_local
WHERE sys_category_translated.sys_language_uid = 1
AND sys_category_record_mm.uid_foreign = 627;
@MarkusGehrig
MarkusGehrig / gist:381ed6909c73d91d1d255f2c30123549
Created August 16, 2018 09:59 — forked from maddy2101/gist:5668835
TCA, Model and Fluid Partial to display FAL images as a simple gallery using TYPO3 and Extbase 6.1
SQL:
images int(11) unsigned DEFAULT '0',
=======================================================
TCA
....
'images' => array(
'exclude' => 0,
'label' => 'images',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'images',
SELECT @new_mails := `list` FROM `sys_dmail_group` WHERE `uid` = '34';
UPDATE `sys_dmail_group` SET `list` = CONCAT(`list`, @new_mails) WHERE `uid` = '33';
SELECT @number_of_mails := LENGTH(`list`) - LENGTH(REPLACE(`list`, ',', '')) FROM `sys_dmail_group` WHERE `uid` = '33';
UPDATE `sys_dmail_group` SET `static_list` = @number_of_mails WHERE `uid` = '33';