Skip to content

Instantly share code, notes, and snippets.

@aertmann
aertmann / ContentCollectionImplementation.php
Last active January 13, 2021 13:42
Slide support in content collection
<?php
namespace TYPO3\NeosDemoTypo3Org\TypoScript;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\TYPO3CR\Domain\Model\NodeInterface;
/**
* Extended TypoScript implementation to render ContentCollections. Will render needed
* metadata for removed nodes and has support for slide.
*/
@aertmann
aertmann / mount.md
Last active August 22, 2019 09:07
Problem: NFS mount not working in Finder, but works in Terminal – OS X El Capitan (10.11)

Solution

Add vers=4 to the mount command.

sudo mount -o vers=4,resvport,rw -t nfs x.x.x.x:/home mount
@aertmann
aertmann / Method1.html
Last active September 7, 2018 21:21
Inline editable properties for a document node (two different approaches) – TYPO3 Neos
<neos:contentElement.wrap node="{node}">
<header>
<neos:contentElement.editable property="title" tag="h1" />
</header>
</neos:contentElement.wrap>
@aertmann
aertmann / Policy.yaml
Last active August 28, 2018 13:13
Multi-site access restriction with Neos CMS
privilegeTargets:
'Neos\Flow\Security\Authorization\Privilege\Entity\Doctrine\EntityPrivilege':
'Acme.Package:Site.Alpha':
matcher: 'isType("Neos\Neos\Domain\Model\Site") && property("nodeName") == "alpha"'
'Acme.Package:Site.Beta':
matcher: 'isType("Neos\Neos\Domain\Model\Site") && property("nodeName") == "beta"'
'Neos\Neos\Security\Authorization\Privilege\NodeTreePrivilege':
@aertmann
aertmann / Settings.yaml
Last active August 28, 2018 13:13
Multi-site access restriction with Neos CMS
Neos:
Flow:
security:
authentication:
providers:
NeosBackendProvider:
provider: 'Acme\Package\Security\Authentication\Provider\SiteAwarePersistedUsernamePasswordProvider'
@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 / gist:33c74c10f76edc26ed67
Last active April 23, 2018 11:28
Add target _blank to external links in Neos – Included in https://speakerdeck.com/aertmann/tasty-recipes-for-every-day-neos
<?php
namespace Acme\Acme\TypoScript;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Neos\Domain\Exception;
use TYPO3\Neos\Service\LinkingService;
use TYPO3\TYPO3CR\Domain\Model\NodeInterface;
use TYPO3\TypoScript\TypoScriptObjects\AbstractTypoScriptObject;
/**
@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 / FlickrOperation.php
Created March 26, 2015 23:10
Get custom data (Flickr feed) in TypoScript using a custom FlowQuery operation in Neos – Included in https://speakerdeck.com/aertmann/tasty-recipes-for-every-day-neos
<?php
namespace Venstre\VenstreDk\TypoScript\FlowQueryOperations;
use TYPO3\Eel\FlowQuery\FlowQuery;
use TYPO3\Eel\FlowQuery\Operations\AbstractOperation;
use TYPO3\Flow\Annotations as Flow;
class FlickrOperation extends AbstractOperation {
const API_KEY = '';
@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}">