Skip to content

Instantly share code, notes, and snippets.

@aertmann
aertmann / Caches.yaml
Last active January 16, 2017 14:15
Keep session storage through cache flushing to prevent users being logged out in Neos – Included in https://speakerdeck.com/aertmann/tasty-recipes-for-every-day-neos
# Flow 3.0+
Flow_Session_Storage:
persistent: TRUE
Flow_Session_MetaData:
persistent: TRUE
# Flow 2.0-2.3 (only works with Surf deployment – not flow:cache:flush command)
Flow_Session_Storage:
backendOptions:
@aertmann
aertmann / Caches.yaml
Last active June 22, 2018 09:28
Use Redis or Memcached cache backends for optimizing certain caches that has tags which become slow with lots of content in Neos – Included in https://speakerdeck.com/aertmann/tasty-recipes-for-every-day-neos
# Redis (has to be configured to different databases on shared hosting)
TYPO3_TypoScript_Content:
backend: TYPO3\Flow\Cache\Backend\RedisBackend
backendOptions:
defaultLifetime: 0
Flow_Mvc_Routing_Resolve:
backend: TYPO3\Flow\Cache\Backend\RedisBackend
backendOptions:
defaultLifetime: 0
@aertmann
aertmann / Donate.ts2
Last active February 12, 2018 21:30
Donation plugin for Neos using form framework and custom payment gateway integration (QuickPay) – Included in https://speakerdeck.com/aertmann/tasty-recipes-for-every-day-neos
prototype(Acme.Donate:Donate) < prototype(TYPO3.Neos:Plugin) {
package = 'Venstre.VenstreDk'
controller = 'Donate'
node = ${node}
}
@aertmann
aertmann / Article.html
Last active December 8, 2017 15:43
News with inline editable headline & lead & image, list view with ajax loading, overview, single view, tagging and RSS using News document node type and Elasticsearch for Neos – Included in https://speakerdeck.com/aertmann/tasty-recipes-for-every-day-neos
{namespace neos=TYPO3\Neos\ViewHelpers}
{namespace media=TYPO3\Media\ViewHelpers}
<f:layout name="Page" />
<f:section name="body">
<article itemscope="" itemtype="http://schema.org/Article" xmlns:f="http://www.w3.org/1999/html">
<header>
<f:if condition="{tags}">
<f:for each="{tags}" as="articleTag" iteration="iterator">
<f:if condition="{iterator.isFirst}">
@aertmann
aertmann / Images.html
Last active August 17, 2016 08:34
Image partial for responsive images in Neos – Included in https://speakerdeck.com/aertmann/tasty-recipes-for-every-day-neos
{namespace media=TYPO3\Media\ViewHelpers}
<media:image
additionalAttributes="{srcset: '{media:uri.image(image: image, maximumWidth: 400)} 2x,
{media:uri.image(image: image, maximumWidth: 200)} 1x'}"
asset="{image}"
alt="{alternativeText}"
title="{title}"
maximumWidth="200" />
@aertmann
aertmann / .gitignore
Last active August 29, 2015 14:17
Optimize Neos/Flow frontend assets using Grunt – Included in https://speakerdeck.com/aertmann/tasty-recipes-for-every-day-neos
node_modules
@aertmann
aertmann / Root.ts2
Created March 27, 2015 00:05
Optimize the editor experience with custom JavaScript & CSS in Neos – Included in https://speakerdeck.com/aertmann/tasty-recipes-for-every-day-neos
prototype(Page) {
head.stylesheets.backend = TYPO3.TypoScript:Tag {
tagName = 'link'
attributes {
rel = 'stylesheet'
href = TYPO3.TypoScript:ResourceUri {
package = 'Venstre.VenstreDk'
path = 'Styles/Backend.css'
}
}
function reloadCards() {
var cardsContainer = $('.cards');
if (cardsContainer.data('masonry')) {
cardsContainer.masonry('reloadItems').masonry('layout');
}
}
function initializeResize(elements) {
elements.resize(function() {
var cardsContainer = $('.cards');
-
name: 'Google Sitemap'
uriPattern: '{node}sitemap.xml'
defaults:
'@package': 'TYPO3.Neos'
'@controller': 'Frontend\Node'
'@action': 'show'
'@format': 'xml'
routeParts:
'node':
@aertmann
aertmann / NodeTypes.yaml
Created March 26, 2015 23:27
Meta description tag for pages in Neos – Included in https://speakerdeck.com/aertmann/tasty-recipes-for-every-day-neos
'TYPO3.Neos.NodeTypes:Page':
ui:
inspector:
groups:
document:
label: 'Document'
position: 1
properties:
metaDescription:
type: string