Skip to content

Instantly share code, notes, and snippets.

@kraftb
kraftb / gist:8844198
Created February 6, 2014 13:33
Counting TYPO3 pages in a branch
1. Create a table which helps us for this task:
CREATE TABLE ClosureTable (ancestor_id INT NOT NULL, descendant_id INT NOT NULL, path_length INT NOT NULL, PRIMARY KEY (ancestor_id, descendant_id));
2. Execute the following queries:
INSERT INTO ClosureTable (ancestor_id, descendant_id, path_length) SELECT 0,0,0;
INSERT INTO ClosureTable (ancestor_id, descendant_id, path_length) SELECT uid, uid, 0 FROM pages;
@pbojinov
pbojinov / README.md
Last active June 27, 2025 05:25
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@helhum
helhum / YoutubeProcessing.php
Created July 11, 2014 08:56
FAL Processing
<?php
namespace Helhum\ProcessingServices\Resource\Processing;
use TYPO3\CMS\Core\Utility;
class YoutubeProcessing {
/**
* @var \TYPO3\CMS\Core\Resource\Processing\LocalImageProcessor
*/
protected $processor;
@kraftb
kraftb / README.md
Last active October 19, 2022 14:25
Completely clear the cache of a TYPO3 instance (filesystem, database)

Script for clearing all TYPO3 caches

This script aims to clear all (yes. really all) caches being used by TYPO3. So the file caches in typo3temp and typo3conf/autoload, next the database caches in tables cf_* and eventual realurl caches. And finally any PHP caches like those from APC, xcache, or other PHP accelerators/compilers.

Simply install the script at some executable location on your webserver

@htuscher
htuscher / AdditionalConfiguration.php
Last active March 26, 2018 20:00
TYPO3 Multitree without domain records in development
<?php
use TYPO3\CMS\Core\Utility\GeneralUtility;
if (\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->getApplicationContext()->isDevelopment()) {
/**
* This override adds the possibility to use multitree subdomains without domain records (for SHARED_DB, vagrant, etc.)
* You can override the mappings or undo the override by creating a config file inside conf.d
*
* The override PageRepository checks for $subdomain . exec('hostname -f')
@cedricziel
cedricziel / BookingPageOneValidator.php
Created April 17, 2015 07:16
Dynamic Validation on controller level
<?php
namespace Websight\MyExt\Validation;
/***************************************************************
* Copyright notice
*
* (c) 2015 Cedric Ziel <[email protected]>
* (c) 2014 Carsten Bleicker <[email protected]>
* All rights reserved
@a-r-m-i-n
a-r-m-i-n / _realurl_domain_language_mapping.md
Last active September 1, 2017 09:45
RealURL Configuration for Domain == Language

This config shows an example of TYPO3 RealURL configuration, to map languages to domains.

Lets say the default language (L=0) is german and the foreign language is english (L=1). Normally RealURL would create links like that:

This example is about getting rid of the /en path segment.

@cedricziel
cedricziel / ext_tables.php
Created May 4, 2015 20:47
Add a custom doktype to TYPO3 pages table
<?php
/**
* Custom Doktypes
*/
// Define a new doktype
$customShortlinkDoktype = 120;
$customPageIcon = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/Shortlink.png';
// Add the new doktype to the list of page types
$GLOBALS['PAGES_TYPES'][$customShortlinkDoktype] = array(
@wolffc
wolffc / extabase_in_controller_action_validation_example.php
Created May 7, 2015 07:34
This is an TYPO3 / Extbase Example on how to Validate some Properties in the Controller - this is usefull for conditonal Validation
<?php
class foo {
/**
* keep trac if we have created a custom error.
* @var boolean
*/
protected $hasCustomError = false;
@oliverthiele
oliverthiele / robots.txt
Last active November 23, 2023 18:18
robots.txt for TYPO3
User-agent: *
# Only allow URLs generated with RealURL
Disallow: /*?id=*
Disallow: /*&id=*
# L=0 is the default language
Disallow: /*?L=0*
Disallow: /*&L=0*