Skip to content

Instantly share code, notes, and snippets.

<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>
@Schweriner
Schweriner / 15_formhandler.ts
Created April 20, 2016 13:00
Conditional Formhandler ErrorCheck
##########################################################################
# KONTAKTFORMULAR
##########################################################################
plugin.Tx_Formhandler.settings.predef.contact {
name = Terminwunsch
addErrorAnchors = 0
formValuesPrefix = formhandler
isErrorMarker.default = error_class
/**
* 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 / TYPO3 Fluid Select Value From Variable List.html
Last active July 6, 2018 22:01
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.
<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"/>
@Schweriner
Schweriner / ViewHelpers_AbstrastFrontendLinkViewHelper.php
Created October 2, 2018 12:40
TYPO3 Fluid Link ViewHelpers to force Frontend Links in Backend Context (e.g. in Command Controllers)
<?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 / EditLinkViewHelper.php
Last active March 20, 2019 12:21
TYPO3 Fluid ViewHelper for creating Backend Edit Links for every Record
<?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 / RequiredFileReferenceFields.js
Created December 6, 2019 16:20
TYPO3 File Reference Fields Required using a small Require JS Modul (Title, Alternative, Description...)
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 / ProduktRepository.php
Created June 10, 2020 10:08
Debug TYPO3 Doctrine Query
$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 / 15_content.typoscript
Created August 10, 2020 08:39
CSC Firstheader with FSC
lib.contentElement {
templateRootPaths {
100 = EXT:bruening_website/Resources/Private/Templates/FluidStyledContent/
}
partialRootPaths {
100 = EXT:bruening_website/Resources/Private/Partials/FluidStyledContent/
}
layoutRootPaths {
100 = EXT:bruening_website/Resources/Private/Layouts/FluidStyledContent/
}
@Schweriner
Schweriner / BranchenbuchCommand.php
Created August 18, 2021 11:01
Migrate DCE Image Field to FAL
/** @var \TYPO3\CMS\Core\Database\Query\QueryBuilder $queryBuilder */
$queryBuilder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)
->getQueryBuilderForTable('tt_content');
$elements = $queryBuilder->select('*')->from('tt_content')
->where(
$queryBuilder->expr()->andX(
$queryBuilder->expr()->eq('CType', $queryBuilder->createNamedParameter('dce_dceuid1')),
$queryBuilder->expr()->eq('deleted', $queryBuilder->createNamedParameter('0'))
)