Skip to content

Instantly share code, notes, and snippets.

View oliverthiele's full-sized avatar

Oliver Thiele oliverthiele

View GitHub Profile
@oliverthiele
oliverthiele / webpack.config.js
Created November 6, 2023 08:57
My webpack config for TYPO3 v11 and v12. Works with public/_asset/[hash] symlinks in TYPO3 v12
'use strict'
// Imports
const {VueLoaderPlugin} = require("vue-loader");
const fs = require('fs');
const path = require('path');
const autoprefixer = require('autoprefixer');
const CopyWebpackPlugin = require("copy-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
@oliverthiele
oliverthiele / LocalStorageSVGs.js
Last active November 6, 2023 09:00
This JavaScript allows multiple icons stored in a sprite file to be used in the web page via LocalStorage. On the first call or when the file revision is changed, the file is downloaded from the server and stored in LocalStorage. So that the DOM is not unnecessarily extended with too many icons, a check is first made to see which icons are prese…
/**
* Version 3.0.0
*
* process.env constants are set via webpack (https://gist.github.com/oliverthiele/6298902d5192aa86f24682a3afbd0d9f)
*/
const assetsUrl = process.env.TYPO3_ASSETS_URL;
const revision = process.env.SVG_REVISION;
export function localStorageSVGs() {
@oliverthiele
oliverthiele / InstallTypo3.sh
Last active July 23, 2023 16:17
Script for installing TYPO3 with v12.4 (or v11.5) LTS on a clean Ubuntu 22.04 root server.
#!/bin/bash
### Before executing this script make a system update:
# $> apt update; apt --assume-yes dist-upgrade; apt --assume-yes autoremove;
# $> reboot
# VirtualBox does not work with ipv6, so you have to disable it before running this script:
# $> sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
@oliverthiele
oliverthiele / GetTypo3Update.sh
Created August 9, 2018 08:47
Download TYPO3 sources and update the symlinks for easy TYPO3 Updates (classic way w/o composer)
#!/bin/bash
version=$1;
major="${version:0:1}"
wget get.typo3.org/$1 -O typo3_src-${1}.tar.gz
wget get.typo3.org/${major}/tar.gz.sig -O typo3_src-${1}.tar.gz.sig
wget -qO- https://get.typo3.org/KEYS | gpg --import
gpg --verify typo3_src-${version}.tar.gz.sig typo3_src-${version}.tar.gz
@oliverthiele
oliverthiele / RST.xml
Created November 30, 2017 11:01
PhpStorm Live Templates for *.rst files
<templateSet group="RST">
<template name="rstRefCoreApi" value=":ref:`Core Api Reference &lt;t3coreapi:$SECTION$&gt;`" description="Core Api Reference" toReformat="false" toShortenFQNames="true">
<variable name="SECTION" expression="" defaultValue="start" alwaysStopAt="true" />
<context>
<option name="Bash" value="false" />
<option name="CSS" value="false" />
<option name="CUCUMBER_FEATURE_FILE" value="false" />
<option name="CoffeeScript" value="false" />
<option name="HAML" value="false" />
<option name="HTML" value="false" />
@oliverthiele
oliverthiele / FluidLayout.html
Created March 12, 2017 16:07
Some of my favorite Live-Templates for PhpStorm
{namespace b=OliverThiele\OtBootstrap3\ViewHelpers}
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:spaceless>
$END$
<f:render section="Content" />
</f:spaceless>
</html>
@oliverthiele
oliverthiele / CssStyledContent2FluidStyledContent.sql
Created September 14, 2016 10:26
TYPO3 DB Updates for switching from EXT:css_styled_conten to EXT:fluid_styled_content
UPDATE tt_content SET CType='textmedia' WHERE tt_content.CType='text';
UPDATE tt_content SET CType='textmedia' WHERE tt_content.CType='textpic';
UPDATE tt_content SET CType='textmedia' WHERE tt_content.CType='images';
UPDATE tt_content LEFT JOIN sys_file_reference ON sys_file_reference.uid_foreign=tt_content.uid AND sys_file_reference.tablenames='tt_content' AND sys_file_reference.fieldname='image' SET tt_content.CType='textmedia', tt_content.assets=tt_content.image, tt_content.image=0, sys_file_reference.fieldname='assets' WHERE tt_content.CType='textpic' OR tt_content.CType='image';
UPDATE be_groups SET explicit_allowdeny=CONCAT(explicit_allowdeny,',tt_content:CType:textmedia:ALLOW') WHERE (explicit_allowdeny LIKE '%tt\\_content:CType:textpic:ALLOW%' OR explicit_allowdeny LIKE '%tt\\_content:CType:image:ALLOW%' OR explicit_allowdeny LIKE '%tt\\_content:CType:text:ALLOW%') AND explicit_allowdeny NOT LIKE '%tt\\_content:CType:textmedia:ALLOW%';
UPDATE be_groups SET explicit_allowdeny=CONCAT(explicit_allowdeny
@oliverthiele
oliverthiele / realurl_conf.php
Last active April 17, 2017 11:21
TYPO3 RealURL-Konfiguration Example
<?php
// Not needed in current RealURL versions: $TYPO3_CONF_VARS['FE']['addRootLineFields'] .= ',tx_realurl_pathsegment';
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array(
'_DEFAULT' => array(
'init' => array(
'enableCHashCache' => true,
'appendMissingSlash' => 'ifNotFile,redirect[301]',
'enableUrlDecodeCache' => true,
'enableUrlEncodeCache' => true,
'adminJumpToBackend' => true,
@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*
@oliverthiele
oliverthiele / Lib.numberedMenu.t3s
Last active August 29, 2015 14:27
TYPO3 Main Navigation
lib.numberedMenu = HMENU
lib.numberedMenu {
entryLevel = 1
1 = TMENU
1 {
wrap = <ul>|</ul>
noBlur = 1
NO = 1
NO {