Skip to content

Instantly share code, notes, and snippets.

View spoonerWeb's full-sized avatar

Thomas Löffler spoonerWeb

View GitHub Profile
@spoonerWeb
spoonerWeb / .gitlab-ci.yml
Last active October 1, 2024 08:23
GitLab CI for building and deploying TYPO3 websites with deployer
cache:
paths:
- /cache/composer
stages:
- composer
- deploy
build:
stage: composer
@spoonerWeb
spoonerWeb / .gitlab-ci.yml
Last active February 12, 2024 10:54
GitLab CI (version >= 9) configuration for testing and TER uploading TYPO3 extensions
cache:
key: "$CI_COMMIT_REF_NAME/$CI_JOB_STAGE"
paths:
- .composer/
before_script:
# Install git on machine
- apk add git --update
stages:
@spoonerWeb
spoonerWeb / bitbucket-pipelines.yml
Created December 30, 2020 09:44
Deployment with composer, npm and deployer with bitbucket pipelines
definitions:
caches:
composer: vendor/
node: frontend/node_modules
steps:
- step: &composer
name: "Install project via composer"
image: composer:2
caches:
- composer
@spoonerWeb
spoonerWeb / README.md
Created April 29, 2020 14:20
TYPO3 Solr Search with AJAX and Middleware (TYPO3 >= 9.5, EXT:solr >= 10)

Solr search via AJAX and Middleware

How To

  • Add this code into your extension
  • Call your domain URL with the parameter ?ajaxsearch=1&q=<search-term>
  • Get JSON with all results based on your TS settings on root page
@spoonerWeb
spoonerWeb / Solr.php
Last active June 28, 2023 08:04
Get result count of Solr search without facets in TYPO3
<?php
namespace Vendor\ExtensionName\Slot;
/*
* This file is part of a TYPO3 extension.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
@spoonerWeb
spoonerWeb / SignedStorageFolders.php
Created January 3, 2023 17:18
TYPO3 - get signed storage in TypoScript
<?php
namespace Vendor\Extension\User;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class SignedStorageFolders
{
public function getSignedStorageFolders(string $content, array $config): string
{
$pidList = $config['pidList'];
@spoonerWeb
spoonerWeb / DataController.php
Created July 20, 2018 12:47
Sending an AJAX request to get Extbase objects
<?php
namespace Vendor\Extension\Controller;
use SJBR\StaticInfoTables\Domain\Repository\CountryZoneRepository;
class DataController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{
/**
* @var \TYPO3\CMS\Extbase\Mvc\View\JsonView
*/
@spoonerWeb
spoonerWeb / UPGRADE.md
Last active July 27, 2022 20:38
Upgrading a TYPO3 version / Move to composer

TYPO3 Upgrade

Preparation

Project root == Document root

  1. Create a folder (e.g. public)
  2. Move folders and files into public
    1. fileadmin
  3. uploads
@spoonerWeb
spoonerWeb / Classes_Command_MigrationCommand.php
Last active June 23, 2021 09:51
Migration Contao to TYPO3
<?php
declare(strict_types = 1);
namespace Vendor\Extension\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
@spoonerWeb
spoonerWeb / NumberViewHelper.php
Last active June 15, 2021 10:40
TYPO3 Format NumberViewHelper with automatic config
<?php
namespace Vendor\ExtensionName\ViewHelpers\Format;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Site\SiteFinder;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
class NumberViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Format\NumberViewHelper
{