Skip to content

Instantly share code, notes, and snippets.

View josefglatz's full-sized avatar
👨‍💻

Josef Glatz josefglatz

👨‍💻
View GitHub Profile
@josefglatz
josefglatz / StripATagsViewHelper.php
Created April 28, 2016 05:34
TYPO3 CMS Fluid ViewHelper "StripATagsViewHelper", "Strip all anchor tags viewhelper"
<?php
namespace O10\Theme\ViewHelpers;
/**
* Removes a tags from the given string
*
* ViewHelper initially implemented to use with TYPO3 CMS 6.2.x
*/
class StripATagsViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
{
@josefglatz
josefglatz / stdWrap.replacement.replaceMultilineHtmlMarkupRegex.setupts
Created May 3, 2016 13:11
TYPO3 CMS stdWrap example "replacement :: Replace multiline html markup via regex"
page {
stdWrap.replacement {
10 {
search = #<div class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">[\n\r\s]+<img src="/fileadmin/template/img/toggle.png" />[\n\r\s]+</div>#i
useRegExp = 1
replace.stdWrap.cObject = COA
replace.stdWrap.cObject {
// ... replacement stuff
tt_content.customcontentelement = COA
tt_content.customcontentelement {
10 = FILES
10 {
references {
table = tt_content
uid.data = field:uid
fieldName = image
}
begin = 0
@josefglatz
josefglatz / SrcsetImage.html
Created September 25, 2016 20:24
Typo3 Fluid sourceset image partial with VHS
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"
xmlns:f="http://xsd.helhum.io/ns/typo3/cms-fluid/master/ViewHelpers"
data-namespace-typo3-fluid="true">
<f:section name="SrcsetImage">
<f:if condition="{image}">
<v:variable.set name="imgurl" value="{f:uri.image(image: image,maxWidth: '{maxWidth}')}" />
<v:variable.set name="imgsize" value="{v:media.image.width(src:'{imgurl}')}" />
<v:variable.set name="img480" value="{f:uri.image(image: image,maxWidth:'480')} 480w," />
@josefglatz
josefglatz / Custom TYPO3 CE
Last active September 29, 2016 11:13
Simple Custom TYPO3 CE
// PageTSConfig
mod.wizards.newContentElement.wizardItems {
homepage {
header = Homepage
show = *
elements {
theme-sujet {
title = Big Sujet
description = Main sujet with slider images
tt_content_defValues {
@josefglatz
josefglatz / Table-tt_address-optimal-fieldtype.sql
Created November 24, 2016 14:18
MySQL optimal fieldtype field data type
select * from tt_address PROCEDURE ANALYSE(1,10);
# --
# typo3.tt_address.skype foo 0 27 92 75 3.1215 NULL VARCHAR(27)
# --
@josefglatz
josefglatz / regex
Created November 25, 2016 08:16
Useful TYPO3 regex
# PhpStorm: all comments e.g. in localconf.php
(^)?(//).+
@josefglatz
josefglatz / ConnectNetworkShare.scpt
Last active September 15, 2023 16:05
AppleScript Network Share Connect
-- Handy script for mounting a network share
-- v1.0 2017-01-17, <[email protected]>
-- v1.1.0 2017-01-17, <[email protected]>
set shareName to "Projekte" -- assign share name
set nasIp to "10.0.0.2" -- assign IP of NAS/server
set pingCount to 1
set pingTimeout to 10
tell application "Finder"
<v:if stack="{0: '{v:content.get(column: \"0\")}', 1: 'OR', 2: '{v:content.get(column: \"1\")}'}">
This text is only shown, if colPos 0 and colPos 1 has content elements.
</v:if>
@josefglatz
josefglatz / fluid-modulotest.html
Last active September 15, 2024 13:18
TYPO3 Fluid Easy Modulo (with ext:vhs)
<f:if condition="{i.cycle -> v:math.modulo(b: 3)} === 0">
<div class="break-lg-up"></div>
</f:if>
<!-- without the last item -->
<f:if condition="({i.cycle -> v:math.modulo(b: 3)} === 0) && (!{i.isLast})">
<div class="break-lg-up"></div>
</f:if>