Skip to content

Instantly share code, notes, and snippets.

View kathangeorg's full-sized avatar

Schorsch kathangeorg

View GitHub Profile
@einpraegsam
einpraegsam / NotAuthorized.php
Last active May 10, 2023 21:46
Individual 403 and 404 handling in TYPO3 9 and 10. Show a 404 page but keep wrong URL. In case of a missing frontend login, redirect to login page and redirect back after login.
<?php
declare(strict_types=1);
namespace Vendor\Sitepackage\PageHandler;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Error\PageErrorHandler\PageErrorHandlerInterface;
use TYPO3\CMS\Core\Http\RedirectResponse;
use TYPO3\CMS\Core\Http\Uri;
use TYPO3\CMS\Core\Site\Entity\Site;
@aarongerig
aarongerig / NavigationExtension.php
Last active January 13, 2021 11:19
[Pimcore] Custom Twig Navigation Builder
<?php
declare(strict_types=1);
namespace AppBundle\Twig\Extension;
use Pimcore\Model\DataObject;
use Pimcore\Model\Document;
use Pimcore\Navigation\Container;
use Pimcore\Templating\Helper\Navigation;
@ajaxray
ajaxray / wkhtmltopdf.sh
Last active August 9, 2022 03:28 — forked from Rajeshr34/wkhtmltopdf.sh
Install wkhtmltopdf with Patched QT for CentOS 7 or RHEL 7.x
cd ~
yum install -y xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 openssl git-core fontconfig
wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
mv wkhtmltox/bin/wkhtmlto* /usr/bin
# Thanks to
# https://jaimegris.wordpress.com/2015/03/04/how-to-install-wkhtmltopdf-in-centos-7-0/
# https://gist.github.com/Rajeshr34/2e9b2438ff142e51c729b4b9b772680a
@manuelselbach
manuelselbach / HowToAddACustomElementForTheFormEditorOfExtForm.md
Last active May 23, 2024 21:40
How to add a custom element for the formEditor of ext:form

EXT:form How to add a custom form element

If you like to add a custom form element, please follow these steps. For detailed information and documentation of ext:form please visit the official documentation: https://docs.typo3.org/typo3cms/extensions/form/Index.html

Basics

First of all create a new extension, which will hold all the configuration, templates, etc.

@xperseguers
xperseguers / MyCustomActionBackend.yaml
Last active May 19, 2020 15:41
Custom finisher for EXT:form in TYPO3 v8
# File EXT:your_ext/Configuration/Yaml/MyCustomActionBackend.yaml
TYPO3:
CMS:
Form:
prototypes:
# add our finisher to the 'standard' form prototype
standard:
formElementsDefinition:
Form:
formEditor:
@htuscher
htuscher / ExtbaseForceLanguage.php
Last active August 29, 2023 11:04
TYPO3 Extbase get record with language different than FE or 0
<?php
namespace Onedrop\Common\Service;
/***************************************************************
* Copyright notice
*
* (c) 2015 Hans Höchtl <hhoechtl@1drop.de>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
anonymous
anonymous / i3config
Created January 16, 2016 06:59
# Set desktop resolution to 1920x1080
exec xrandr --output eDP1 --mode 1920x1080
# Set desktop wallpaper
exec feh --bg-scale ~/Pictures/solarized.png
# Disable window borders
for_window [class="^.*"] border pixel 0
# Adds gaps
@humantorch
humantorch / http_accept_language.php
Last active February 26, 2021 21:37
Compare supported languages with HTTP_ACCEPT_LANGUAGE in a users' browser.
<?php
// Languages we support
$available_languages = array("zh-cn", "ca", "es", "fr", "af","nl", "sp", "en");
$default_language = "en"; // a default language to fall back to in case there's no match
function prefered_language($available_languages, $http_accept_language) {
global $default_language;
$available_languages = array_flip($available_languages);
@bjrnqprs
bjrnqprs / gist:5487083
Last active September 7, 2018 11:25
Typo3 6.0 - Generate a cHash (Note: differs from cache identifier in Extbase caching framework)
<?php
/* @var $cacheHash \TYPO3\CMS\Frontend\Page\CacheHashCalculator */
$cacheHash = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\CacheHashCalculator');
$result = $cacheHash->generateForParameters($_SERVER['QUERY_STRING']);