Skip to content

Instantly share code, notes, and snippets.

@chriwo
chriwo / CustomFileUpload.php
Created March 1, 2023 10:18
Integrate a file upload for a custom file field with EXT:femanager v6.3.4
<?php
declare(strict_types=1);
namespace Vendor\ExtensionName\DataProcessor;
use Exception;
use In2code\Femanager\DataProcessor\ImageManipulation;
use In2code\Femanager\Domain\Service\FileService;
use In2code\Femanager\Utility\FileUtility;
@chriwo
chriwo / constants.typoscript
Last active June 25, 2021 08:25
Powermail - Anpassung der Email Absender Adresse. In dem Powermailformular müssen die Hacken für "Dieses Feld beinhaltet den Namen des Absenders" und "Dieses Feld beinhaltet die E-Mail des Absenders" entfernt werden.
plugin.tx_powermail.settings {
receiver {
overwrite {
senderName = Name des Webseitenbetreiber
senderEmail = Email Adresse des Webseitenbetreiber, z.B. no-reply@domain.com
}
}
sender {
mailformat = html
@chriwo
chriwo / PageTs.typoscript
Created July 30, 2018 08:44
Override CkEditor configuration with PageTs
RTE {
config {
tt_content {
DB-FIELD-NAME {
types.NAME-OF-CTYPE {
editor.externalPlugins.wordcount.maxCharCount = 5
}
}
}
@chriwo
chriwo / realurl_conf.php
Last active June 29, 2018 07:12
RealUrl Multidomain setup with configuration for tx_news. You could copy & paste the code, but it's important to change line 4 and line 133. Replace the domain name and the PAGE_UID. In line 133 it's needed to replace the PAGE_UID with the page number of the detail news page.
<?php
$domainConfiguration = [
'www.first-domain.com' => PAGE_UID,
//'www.second-domain.com' => PAGE_UID,
//'www.third-domain.com' => PAGE_UID
];
$txRealUrlConfiguration = [
'init' => [
@chriwo
chriwo / tt_address_selectBox.js
Last active June 18, 2018 08:14
Build a select box of tt_address user. Changes in select box get full information of tt_address user, e.g. phone, address, email. The CSS classes and id's would be work with twitter bootstrap. TYPO3 v6.2
jQuery(document).ready(function() {
var dselect = jQuery('.contact-select').val();
jQuery('.contact div#contact-' + dselect).show();
jQuery('.contact-select').on('change', function() {
var cselect = jQuery(this).val();
jQuery('.contact div.contact-wrapper').hide();
jQuery('.contact div#contact-' + cselect).show();
@chriwo
chriwo / viewport-output.html
Created February 1, 2018 12:57
Display the used bootstrap viewport
<div class="whatbreakPoint" style="position:fixed;bottom:0;right:0;width:100px;height:20px;background-color:yellow;text-align:center;">
<div class="visible-xs-block">XS</div>
<div class="visible-sm-block">SM</div>
<div class="visible-md-block">MD</div>
<div class="visible-lg-block">LG</div>
</div>
@chriwo
chriwo / htaccess
Last active February 1, 2018 12:36
Redirect all to index.html
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteRule ^.*$ /index.html [L,R=301]
@chriwo
chriwo / php-cs-fixer-typo3.dist
Last active November 23, 2017 21:48
Configuration file of PHP-CS-FIXER for TYPO3 projects
<?php
$header = <<<'EOF'
This file is part of PHP CS Fixer.
(c) Fabien Potencier <fabien@symfony.com>
Dariusz Rumiński <dariusz.ruminski@gmail.com>
This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
@chriwo
chriwo / meta-tags-setup.txt
Created August 22, 2017 08:08
Include MetaTags with typoscript and integrate an condition for tx_news
page = PAGE
page {
meta {
viewport = {$page.meta.viewport}
format-detection = telephone=no
robots = {$page.meta.robots}
google = {$page.meta.google}
@chriwo
chriwo / debug.php
Created July 31, 2017 07:35
TYPO3 Query debug function
/**
* Debugs a SQL query from a QueryResult
*
* @param QueryResult $queryResult
* @param boolean $explainOutput
* @return void
*/
public function debugQuery(QueryResult $queryResult, $explainOutput = false)
{
$GLOBALS['TYPO3_DB']->debugOuput = 2;