Skip to content

Instantly share code, notes, and snippets.

@Schweriner
Schweriner / ProduktRepository.php
Created Jun 10, 2020
Debug TYPO3 Doctrine Query
View ProduktRepository.php
$queryParser = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::class);
$sql = $queryParser->convertQueryToDoctrineQueryBuilder($query)->getSQL();
$paramters = $queryParser->convertQueryToDoctrineQueryBuilder($query)->getParameters();
$search = array();
$replace = array();
foreach ($paramters as $k => $v) {
$search[] = ':' . $k;
$replace[] = '\'' . $v . '\'';
}
$sql = str_replace($search, $replace, $sql);
@Schweriner
Schweriner / RequiredFileReferenceFields.js
Created Dec 6, 2019
TYPO3 File Reference Fields Required using a small Require JS Modul (Title, Alternative, Description...)
View RequiredFileReferenceFields.js
define(['jquery'], function($) {
$(document).on('t3-formengine-postfieldvalidation',function() {
validateReferenceFields();
});
$(document).on('change','.t3js-form-field-eval-null-placeholder-checkbox input', function() {
validateReferenceFields();
});
@Schweriner
Schweriner / EditLinkViewHelper.php
Last active Mar 20, 2019
TYPO3 Fluid ViewHelper for creating Backend Edit Links for every Record
View EditLinkViewHelper.php
<?php
namespace Vendor\YourExt\ViewHelpers;
/*
* 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.
*
@Schweriner
Schweriner / ViewHelpers_AbstrastFrontendLinkViewHelper.php
Created Oct 2, 2018
TYPO3 Fluid Link ViewHelpers to force Frontend Links in Backend Context (e.g. in Command Controllers)
View ViewHelpers_AbstrastFrontendLinkViewHelper.php
<?php
namespace Netzmagnet\SubscribeEverything\ViewHelpers;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Utility\EidUtility;
use \TYPO3\CMS\Backend\Utility\BackendUtility;
abstract class AbstrastFrontendLinkViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper
@Schweriner
Schweriner / TYPO3 Fluid Select Value From Variable List.html
Last active Jul 6, 2018
You cannot use the value of a variable directly as option="{var: 'Label'}" of a f:form.select. This is a workaround to do it.
View TYPO3 Fluid Select Value From Variable List.html
<f:form.select property="sichtbarfuergruppe"
options="{
0: {
'uid': '{settings.whatEver}',
'label': 'Vorlesungsplaner und Dozenten'
},
1: {
'uid': '{settings.adminUserGroupId}',
'label': 'Nur Vorlesungsplaner'
}}" optionLabelField="label" optionValueField="uid"/>
View OrganisationRepository.php
/**
* Dispatches magic methods (findBy[Property]())
* http://etobi.de/blog/2011/10/multi-property-magic-finder/
* @param string $methodName The name of the magic method
* @param string $arguments The arguments of the magic method
* @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\UnsupportedMethodException
* @return void
* @api
*/
public function __call($methodName, $arguments) {
@Schweriner
Schweriner / 15_formhandler.ts
Created Apr 20, 2016
Conditional Formhandler ErrorCheck
View 15_formhandler.ts
##########################################################################
# KONTAKTFORMULAR
##########################################################################
plugin.Tx_Formhandler.settings.predef.contact {
name = Terminwunsch
addErrorAnchors = 0
formValuesPrefix = formhandler
isErrorMarker.default = error_class
View Flexform Folder
<settings.galleryFolder>
<TCEforms>
<label>Galerie-Ordner wählen</label>
<config>
<type>group</type>
<minItems>1</minItems>
<internal_type>folder</internal_type>
</config>
</TCEforms>
</settings.galleryFolder>
You can’t perform that action at this time.