Skip to content

Instantly share code, notes, and snippets.

@Bjoelin
Bjoelin / gist:dadf1edf30b3d2995bd3b9e28b861191
Created August 19, 2016 19:42
TYPO3 - TCA Input Field Rendering Example - Select Tree
'selected_categories' => array(
'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:selected_categories',
'config' => array(
'type' => 'select',
'renderType' => 'selectTree',
'foreign_table' => 'sys_category',
'foreign_table_where' => 'AND sys_category.sys_language_uid IN (0,-1) ORDER BY sys_category.title ASC',
'size' => 10,
'autoSizeMax' => 50,
'maxitems' => 9999,
@Bjoelin
Bjoelin / gist:d103402743bc208bffe4c4ea01d49721
Created August 19, 2016 19:50
TYPO3 - TCA Input Field Rendering Example - Side by Side Select Fields
'ps_blog_tags' => array(
'exclude' => 0,
'label' => 'LLL:EXT:xxx/Resources/Private/Language/locallang_db.xlf:tx_xxx_domain_model_post.tags',
'config' => array(
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'foreign_table' => 'tx_xxx_domain_model_tag',
'MM' => 'tx_xxx_post_tag_mm',
'size' => 10,
'autoSizeMax' => 30,
@Bjoelin
Bjoelin / gist:6c1dcb1296c16dd335172882e2f34d65
Created September 7, 2016 14:22
Overrides aspect ratios for TYPO3 Image crop overlay modal
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
/*
Defaults
'ratios' => array(
'1.7777777777777777' => 'LLL:EXT:lang/locallang_wizards.xlf:imwizard.ratio.16_9',
'1.3333333333333333' => 'LLL:EXT:lang/locallang_wizards.xlf:imwizard.ratio.4_3',
'1' => 'LLL:EXT:lang/locallang_wizards.xlf:imwizard.ratio.1_1',
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
<?php
namespace ZC\Zebracode\ViewHelpers\Youtube;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
/**
* Class YoutubePlaceholderViewHelper
* @package ZC\Zebracode\ViewHelpers
@Bjoelin
Bjoelin / typo3-fluid-is-in-rootline.txt
Last active February 16, 2021 22:31
How to check if a page is within the rootline of another page in TYPO3 Fluid
<f:comment>Regular syntax</f:comment>
<v:condition.iterator.contains needle="<the page id>" haystack="{v:page.rootline() -> v:iterator.extract(key: 'uid')}">
<f:then></f:then>
<f:else></f:else>
</v:condition.iterator.contains>
<f:comment>Inline syntax</f:comment>
{v:condition.iterator.contains(