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 / RespectAccessInSelect.php
Last active August 29, 2015 14:05
Add access rights check to TCA select lists in TYPO3
<?php
namespace Company\Extension\UserFunctions;
/***************************************************************
* Copyright notice
*
* (c) 2014 Armin Rüdiger Vieweg <armin@v.ieweg.de>
*
* All rights reserved
*
@a-r-m-i-n
a-r-m-i-n / Crop.js
Created August 13, 2014 13:48
AngularJS filter to crop text and respect word boundaries
'use strict';
app.filter('crop', function(){
return function(input, limit, respectWordBoundaries, suffix){
if (input === null || input === undefined || limit === null || limit === undefined || limit === '') {
return input;
}
if (angular.isUndefined(respectWordBoundaries)) {
respectWordBoundaries = true;
}
if (angular.isUndefined(suffix)) {
@a-r-m-i-n
a-r-m-i-n / array2ts.php
Last active July 22, 2023 17:52
Method to convert array to TypoScript string
<?php
/**
* Converts given array to TypoScript
*
* @param array $typoScriptArray The array to convert to string
* @param string $addKey Prefix given values with given key (eg. lib.whatever = {...})
* @param integer $tab Internal
* @param boolean $init Internal
* @return string TypoScript
@a-r-m-i-n
a-r-m-i-n / WhateverCommandController.php
Created October 28, 2014 12:38
Command Controller in Extbase for Scheduler Tasks
<?php
// Classes/Command/WhateverCommandController.php
/**
* Whatever controller
*
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*
*/
@a-r-m-i-n
a-r-m-i-n / page.ts
Created November 5, 2014 15:47
Using Fluid-Templates in TYPO3
page = PAGE
page {
typeNum = 0
10 =< lib.templates.base
}
@a-r-m-i-n
a-r-m-i-n / BackendLayoutFileProvider.php
Created November 5, 2014 15:55
Example of how to provide a BackendLayoutFileProvider in TYPO3 6.2
<?php
namespace sunzinet\Typo3szBase\Provider;
/***************************************************************
* Copyright notice
*
* (c) 2014 Armin Rüdiger Vieweg <armin@v.ieweg.de>
*
* All rights reserved
*
@a-r-m-i-n
a-r-m-i-n / OverrideIconOverlayHook.php
Created November 25, 2014 13:51
Approach to add my own overlay icons to pages in TYPO3
<?php
namespace Sunzinet\SzPagesettings\Hooks;
/**
* Class OverrideIconOverlay
*
* @package Sunzinet\SzFalExpiredate\Hooks
*/
class OverrideIconOverlayHook {
@a-r-m-i-n
a-r-m-i-n / fieldconfiguration.xml
Created January 21, 2015 13:23
DCE field configuration for FAL inline field with
<config>
<type>inline</type>
<foreign_table>sys_file_reference</foreign_table>
<foreign_field>uid_foreign</foreign_field>
<foreign_sortby>sorting_foreign</foreign_sortby>
<foreign_table_field>tablenames</foreign_table_field>
<foreign_match_fields>
<fieldname>images</fieldname> <!-- Name of variable! -->
</foreign_match_fields>
<foreign_label>uid_local</foreign_label>
@a-r-m-i-n
a-r-m-i-n / FluidTemplate.html
Last active July 30, 2020 14:02
How to render responsive images in fluid templates (dce example)
{namespace dce=ArminVieweg\Dce\ViewHelpers}
<f:layout name="Default" />
<f:section name="main">
<f:for each="{dce:fal(field:'images', contentObject:contentObject)}" as="image">
<!-- This is the normal unresponsive way -->
<f:image image="{image}" />
<!-- Here we referer to typoscript to render the responsive image -->
<f:cObject typoscriptObjectPath="lib.responsiveImage" data="{image.uid}"></f:cObject>
</f:for>
@a-r-m-i-n
a-r-m-i-n / mainMenu.ts
Last active August 29, 2015 14:14
Simple <ul> Menu using TypoScript
lib.mainMenu = HMENU
lib.mainMenu {
1 = TMENU
1 {
noBlur = 1
expAll = 1
NO = 1
NO.wrapItemAndSub = <li class="first">|</li>|*|<li>|</li>|*|<li class="last">|</li>