Skip to content

Instantly share code, notes, and snippets.

"use strict";
var $ = require('jquery');
$("#navbar.navbar-collapse")
.on('show.bs.collapse', function() {
var $navbar = $(this);
// TODO: Check whether we really need a backdrop (most probably for iphone)
if ('ontouchstart' in document.documentElement) {
// if mobile we use a backdrop because click events don't delegate
@bnf
bnf / TYPO3 EXT:canonical.md
Last active March 29, 2017 17:06
Canonical TYPO3

Requirements

  • ignore tracking parameter
    • equal to cHashExcludesParameters or more than those?
  • non yet translated pages => canonical to L=0
    • what should be done for plugins that render L=0 content (because l=1 not yet availble) on L=1 pages (canonical should theoretically point to L=0)
  • API: Usecases:
    • Plugins need to be able to define the canonical url of the current page, for e.g.
      • search page 10 may be set to be canonical to page 1
  • detail view in context of some category may be canonical to detail view without category
@bnf
bnf / README.md
Created September 8, 2017 19:32
typo3-console 4.8.0 dce incompatibility

During install:generatepackagestates typo3_console calls cache:flush which loads configuration from ext_localconf.php. DCE tries to generate caches when ext_localconf.php is loaded. They'll initializend initializes Output of composer install

$ php70 /usr/bin/composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 20 installs, 0 updates, 0 removals
  - Installing typo3/cms-composer-installers (1.4.2): Loading from cache
@bnf
bnf / README.md
Last active December 11, 2017 13:32
TYPO3 init-remote.php

Usage

HEADS UP! It's important to add a trailing folder named "/repo". That folder is the deployment endpoint and is named "repo" by convention. The script will create folders /path/to/root/repo and /path/to/root/releases and a symlink /path/to/root/current pointing to the current version in the releases folder. That means when using a web-dir called "web" your webserver's document root needs to point to /path/to/root/current/web.

composer config extra.remote.production ssh://user@host:22/absolute/path/to/root/repo
php init-remote.php production
list($childClass, $caller) = debug_backtrace(false, 2);
file_put_contents('./caller.log', $objectName . PHP_EOL . ' ' . $caller['class'] . '::' . $caller['function'] . PHP_EOL . ' ' . $childClass['file'] . ' (' . $childClass['line'] . ')' . PHP_EOL, FILE_APPEND);
@bnf
bnf / a-psr14-psr11-service-provider-example.php
Last active January 31, 2019 13:27
Chained PSR-14 ListenerProviderInteface's, autoconfigured using container-interop/service-providers
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use Bnf\Di\Container;
use Crell\Tukio\Dispatcher;
use Interop\Container\ServiceProviderInterface;
use Psr\Container\ContainerInterface;
use Psr\EventDispatcher\ListenerProviderInterface;
use Psr\EventDispatcher\EventDispatcherInterface;

Demonstration that conflicts don't make composer convenient.

First run:

$ composer install

Then

$ composer require typo3/cms-about
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bnf
bnf / Makefile
Last active April 20, 2022 14:13
Makefile wrapper for TYPO3 core Gruntfile – location: Build/Makefile
.PHONY: assets css js install help watch build
HAS_DDEV_CONFIG=$(if $(wildcard ../.ddev/config.yaml),1)
IS_IN_DDEV_CONTAINER=${IS_DDEV_PROJECT}
# Generate "ddev exec" prefix if ddev is configured and not running inside the ddev container
COMMAND_PREFIX=$(if $(HAS_DDEV_CONFIG),$(if $(IS_IN_DDEV_CONTAINER),,(ddev exec -s web true >/dev/null || ddev start) && ddev exec -s web -d /var/www/html/Build))
YARN=$(COMMAND_PREFIX) yarn
GRUNT=$(COMMAND_PREFIX) node_modules/.bin/grunt
@bnf
bnf / cherry-split.sh
Last active February 6, 2023 18:29 — forked from ohader/cherry-split.sh
TYPO3 Git Commit Splitter
#!/bin/sh
###
# TYPO3 Git Cherry-Picked Commit Splitter ("Cherry-Split")
# @author Oliver Hader <oliver@typo3.org>
# @license GPL v2 on any later version
#
# Usage
# - cherry-pick change to local Git working copy
# - execute this script `./cherry-split.sh` which processed the tip commit