Skip to content

Instantly share code, notes, and snippets.

Avatar

Stig Nørgaard Færch stigfaerch

View GitHub Profile
@stigfaerch
stigfaerch / Header.html
Created Sep 12, 2019
TYPO3 with fluid_styled_template - Implement defaultHeaderType from registers
View Header.html
--- public/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Header/Header.html (date 1566293615000)
+++ public/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Header/Header.html (date 1566293615000)
@@ -38,7 +38,7 @@
<f:if condition="{default}">
<f:render partial="Header/Header" arguments="{
header: header,
- layout: default,
+ layout: '{f:cObject(typoscriptObjectPath:\'lib.contentElement.cObjects.defaultHeaderType\')}',
positionClass: positionClass,
link: link}" />
@stigfaerch
stigfaerch / composer autoload custom extension
Last active Aug 22, 2018 — forked from t3easy/README.md
Non composer extension insight composer mode TYPO3
View composer autoload custom extension
1. Copy your extension to `[web/]typo3conf/ext/` of your composer mode TYPO3 (or kickstart one with extension_builder).
2. Add autoload entry to your root composer.json (that one which requires "typo3/cms")
```json
"autoload": {
"psr-4": {
"T3easy\\MyExt\\": "web/typo3conf/ext/my_ext/Classes/"
}
}
```
3. Run `composer dump-autoload -a` to update the autoloader.
@stigfaerch
stigfaerch / gist:8756668fbfbfa4d3c29be8f12ef6b9c7
Last active Aug 3, 2018
Box.com DAV - curl - create folder, upload/download file
View gist:8756668fbfbfa4d3c29be8f12ef6b9c7
#create folder
curl -u me@email.com:mypassword -X MKCOL "https://dav.box.com/dav/remote_foldername"
#upload
curl -u me@email.com:mypassword -T local_file_path https://dav.box.com/dav/remote_file_name
#download
curl -u me@email.com:mypassword https://dav.box.com/dav/remote_file_name --output download_file_path
@stigfaerch
stigfaerch / gist:16d22bc1c8c56011d86d
Created Jan 28, 2016
TYPO3 Fluid ViewHelper - StringContains
View gist:16d22bc1c8c56011d86d
<?php
name SOME\NAMESPACE;
class StringContainsViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
/**
* Returns true depending on $needle in $haystack and which mode is chosen
* @param string $haystack
* @param string $needle
* @param string $mode - contains, beginsWith, endsWith
@stigfaerch
stigfaerch / gist:2056dc6591f9b9cad686
Created Oct 30, 2014
TYPO3 Neos - typoscript - solution when this.property doesn't work
View gist:2056dc6591f9b9cad686
prototype(TYPO3.Neos.NodeTypes:Text) {
number = ${q(node).property('number')}
@override.number = ${this.number}
#override makes it possible to insert number to class - as this.number wouldn't work here:
attributes.class.@process.addNumber = ${value + ' number-' + number}
}