Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🐧

Urs Braem ursbraem

💭
🐧
View GitHub Profile
@ursbraem
ursbraem / gulpfile.js
Created Jan 29, 2020
gulpfile for less and js
View gulpfile.js
//*********** IMPORTS *****************
var gulp = require('gulp');
var less = require('gulp-less');
//var autoprefixer = require('gulp-autoprefixer');
var gutil = require('gulp-util');
var rename = require("gulp-rename");
var map = require("map-stream");
var concat = require("gulp-concat");
var watch = require("gulp-watch");
var minifyJS = require('gulp-uglify');
@ursbraem
ursbraem / RegisterMaskcontentIndexer.php
Last active Mar 12, 2019
Mask indexer for ke_search
View RegisterMaskcontentIndexer.php
<?php
namespace STUBR\StubrIndexer;
/*
* This file is part of the TYPO3 CMS project.
*
* 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.
@ursbraem
ursbraem / AdditionalConfiguration.php
Last active Mar 14, 2018 — forked from jrenggli/AdditionalConfiguration.php
pageNotFound_handling for restricted pages in TYPO3
View AdditionalConfiguration.php
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling'] = 'USER_FUNCTION:EXT:usermytemplate/Classes/Utility/PageNotFoundHandling.php:user_pageNotFound->pageNotFound';
// Custom configuration for multi-language 404 page, see EXT:usermytemplate/Classes/Utility/PageNotFoundHandling.php
// ID of the page to redirect to if page was not found
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling_redirectPageID'] = 123;
// ID of the page to redirect to if current page is access protected
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling_loginPageID'] = 789;
View Classes_Resource_ResourceStorageExtended.php
<?php
namespace STUBR\Template\Resource;
/**
* This file is part of the TYPO3 CMS project.
*
* 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.
@ursbraem
ursbraem / layouts-adminlogin.php
Last active Sep 5, 2016
Static file caching for expensive perch queries
View layouts-adminlogin.php
<?php
// layout to prepend to restricted pages
$Users = new PerchUsers;
$CurrentUser = $Users->get_current_user();
if (!(is_object($CurrentUser) && $CurrentUser->logged_in())) {
// user is not logged in to Perch
exit('Please log in first.');
}
View gist:334b22b1c6b702cccaf0e9b525f62339
Uncaught TYPO3 Exception
#1297759968: Exception while property mapping at property path "":It is not allowed to map property "answers". You need to use $propertyMappingConfiguration->allowProperties('answers') to enable mapping of this property. (More information)
TYPO3\CMS\Extbase\Property\Exception thrown in file
/home/username/typo3_src-6.2.26/typo3/sysext/extbase/Classes/Property/PropertyMapper.php in line 112.
16 TYPO3\CMS\Extbase\Property\PropertyMapper::convert(array, "In2code\Powermail\Domain\Model\Mail", TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration)
/home/username/typo3_src-6.2.26/typo3/sysext/extbase/Classes/Mvc/Controller/Argument.php:
00376: }
View Atom Snippet for Perch template comments
'.html':
'Perch Template Comment':
'prefix': 'cmm'
'body': '<!--* $1 *-->'
View Events.html
{namespace n=Tx_News_ViewHelpers}
{namespace stubr=STUBR\Customvhs\ViewHelpers}
<time class="event-date" datetime="<n:format.date format="{f:translate(key:'dateTimeFormatMachine')}">{newsItem.datetime}</n:format.date>">
<f:if condition="{settings.forcelocale}==true">
<stubr:switchlocale new="de_CH.UTF-8" />
</f:if>
<n:format.date format="{f:translate(key:'dateTimeFormatHumanWeekday')}">{newsItem.datetime}</n:format.date>
<f:if condition="{settings.forcelocale}==true">
<stubr:switchlocale new="fr_CH.UTF-8" />
</f:if>
View Condition.php
namespace My\Site\Userfunc;
/**
* This file is part of the TYPO3 CMS project.
*
* 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.
*
* For the full copyright and license information, please read the
View gist:f6b573724c9dad9724a0
options {
// enable upload fields in Element Browser
uploadFieldsInTopOfEB = 1
createFoldersInEB =1
//Add save-and-new to all forms
saveDocNew = 1
// better Page tree
pageTree {
showNavTitle = 1
showPageIdWithTitle = 1