Skip to content

Instantly share code, notes, and snippets.

View a-r-m-i-n's full-sized avatar

Armin Vieweg a-r-m-i-n

View GitHub Profile
@a-r-m-i-n
a-r-m-i-n / MyBackendLayout.ts
Created January 19, 2016 19:30
PageTS based backend layout in TYPO3 7.6
mod.web_layout.BackendLayouts.MyBackendLayout {
title = My Backend Layout
config {
backend_layout {
colCount = 3
rowCount = 1
rows {
1 {
columns {
1 {
@a-r-m-i-n
a-r-m-i-n / AdditionalConfiguration.php
Created July 28, 2015 12:05
Multi language error handling for TYPO3 & RealURL
<?php
$GLOBALS['USER']['vendorname']['domainConfigurations'] = array(
'domain.tld' => array('rootpageUid' => 1, 'languages' => array('en' => 1)),
);
@a-r-m-i-n
a-r-m-i-n / de.locallang.xlf
Last active August 29, 2015 14:23
Basic XLIFF structure for two languages (TYPO3 6.2+)
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0">
<file source-language="en" target-language="de" product-name="extension_key">
<header/>
<body>
<trans-unit id="labelKey"><source></source><target>Deutscher Wert des Labels</target></trans-unit>
</body>
</file>
</xliff>
@a-r-m-i-n
a-r-m-i-n / LocationRepository.php
Created June 25, 2015 13:42
Radial search for Extbase example (unfortunately with old class names)
<?php
class Tx_OldExtension_Domain_Repository_LocationRepository extends Tx_Extbase_Persistence_Repository {
/** Radius of earth */
const EARTH_RADIUS = 6371;
/** Name of table belonging to this repository */
const THIS_TABLE_NAME = 'tx_oldextension_domain_model_location';
/**
@a-r-m-i-n
a-r-m-i-n / constants.ts
Created June 23, 2015 15:14
TypoScript for creating a language dropdown menu (with select and option tags)
global {
languageLabels {
current = Deutsch
availableSysLanguageUids = 0,1
additionalParams = &L=0 || &L=1
availableLabels = Deutsch || English
}
}
@a-r-m-i-n
a-r-m-i-n / slider.ts
Created May 22, 2015 13:22
Image Slider based on media field of pages table (TYPO3 6.2 or greater)
lib.header-slider = COA
lib.header-slider {
stdWrap.wrap = <div class="slider"><ul class="slides">|</ul></div>
10 = FILES
10 {
references{
data = levelmedia:-1, slide
treatIdAsReference = 1
}
renderObj = COA
@a-r-m-i-n
a-r-m-i-n / _realurl_domain_language_mapping.md
Last active September 1, 2017 09:45
RealURL Configuration for Domain == Language

This config shows an example of TYPO3 RealURL configuration, to map languages to domains.

Lets say the default language (L=0) is german and the foreign language is english (L=1). Normally RealURL would create links like that:

This example is about getting rid of the /en path segment.

@a-r-m-i-n
a-r-m-i-n / templates.ts
Created April 2, 2015 14:30
Use FLUIDTEMPLATE cObject and bind page's backend layout to template file
# Initiate template (used by page)
lib.templates.base = FLUIDTEMPLATE
lib.templates.base {
partialRootPath = EXT:typo3sz_assets/Resources/Default/Private/Templates/Partials/
layoutRootPath = EXT:typo3sz_assets/Resources/Default/Private/Templates/Layouts/
variables {
logo =< lib.contents.logo
navMain =< lib.navigations.main
@a-r-m-i-n
a-r-m-i-n / center.css
Created February 27, 2015 11:13
CSS3 Center (horizontally and vertically)
.center {
position: absolute;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
}
@a-r-m-i-n
a-r-m-i-n / PayPal Rest API - Simple Transaction
Created February 26, 2015 10:24
PayPal Rest API - Simple Transaction
This example uses the Rest API PHP SDK of Paypal. To get it, just use composer.