Skip to content

Instantly share code, notes, and snippets.

View cepheiVV's full-sized avatar

Patrick Crausaz cepheiVV

View GitHub Profile
@georgringer
georgringer / Gridelements Configuration
Last active August 7, 2020 09:07
TYPO3 Gridelements, configuration by files without any database involvement
# Page TSConfig:
tx_gridelements.setup {
# Identifier
2col {
title = 2 Spalten
config {
colCount = 2
rowCount = 1
rows {
1 {
@BlackhawkG7
BlackhawkG7 / TYPO3 PageTree
Last active November 2, 2023 14:52
Get 10 levels of the tree recursively starting at $pid | TYPO3 // extbase
// get 10 levels of the tree recursively starting at $pid
$pid = intVal($_GET['id']);
$queryGenerator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\QueryGenerator');
$pidList = $queryGenerator->getTreeList($pid, 10, 0, 1);
$pids = explode(',',$pidList);
@vlucas
vlucas / encryption.ts
Last active May 8, 2025 12:51
Stronger Encryption and Decryption in Node.js
import { createCipheriv, createDecipheriv, randomBytes } from "crypto";
const ENCRYPTION_KEY: string = process.env.ENCRYPTION_KEY || ""; // Must be 256 bits (32 characters)
const IV_LENGTH: number = 16; // For AES, this is always 16
/**
* Will generate valid encryption keys for use
* Not used in the code below, but generate one and store it in ENV for your own purposes
*/
export function keyGen() {
@Gong-Bao-Chicken
Gong-Bao-Chicken / 0020_plugin.indexedsearch.ts
Last active September 9, 2020 08:47
How to Create a (global) Search Box for Typo3 7,8 and probably 9
plugin.tx_indexedsearch {
show {
rules=0
}
settings {
targetPid = YOURPID
displayRules = 0
exactCount = 1
@einpraegsam
einpraegsam / SiteFactory.php
Last active June 10, 2022 13:42
What can you do with SiteConfiguration in TYPO3 and how to get a site object from anywhere?
<?php
declare(strict_types=1);
namespace Vendor\Extension\Factory;
use GuzzleHttp\Psr7\Uri;
use TYPO3\CMS\Core\Exception\SiteNotFoundException;
use TYPO3\CMS\Core\Http\Request;
use TYPO3\CMS\Core\Http\ServerRequest;
use TYPO3\CMS\Core\Routing\SiteMatcher;
use TYPO3\CMS\Core\Site\Entity\Site;
@eliashaeussler
eliashaeussler / query_page_tree.sql
Created August 7, 2023 14:47
Query TYPO3 page tree with MySQL 8+
set @rootPageId := 15047;
set @maxDepth := 99;
with recursive children as (
select root.*, 1 as depth
from pages root
where root.uid = @rootPageId
or (root.sys_language_uid > 0 and root.l10n_source = @rootPageId)
and root.deleted = 0
union all