Skip to content

Instantly share code, notes, and snippets.

View TYPO3 YoutUbe Placeholder Image Viewhelper
<?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 Feb 16, 2021
How to check if a page is within the rootline of another page in TYPO3 Fluid
View typo3-fluid-is-in-rootline.txt
<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(
View Forward www,non-www to https non-www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
@Bjoelin
Bjoelin / gist:6c1dcb1296c16dd335172882e2f34d65
Created Sep 7, 2016
Overrides aspect ratios for TYPO3 Image crop overlay modal
View gist:6c1dcb1296c16dd335172882e2f34d65
<?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',
@Bjoelin
Bjoelin / gist:d103402743bc208bffe4c4ea01d49721
Created Aug 19, 2016
TYPO3 - TCA Input Field Rendering Example - Side by Side Select Fields
View gist:d103402743bc208bffe4c4ea01d49721
'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:dadf1edf30b3d2995bd3b9e28b861191
Created Aug 19, 2016
TYPO3 - TCA Input Field Rendering Example - Select Tree
View gist:dadf1edf30b3d2995bd3b9e28b861191
'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,