Skip to content

Instantly share code, notes, and snippets.

View nezaniel's full-sized avatar

Bernhard Schmitt nezaniel

View GitHub Profile
'CORE4.EventBase:Schema.Event':
abstract: TRUE
ui:
icon: 'icon-calendar'
inspector:
groups:
event:
label: 'Event'
position: 50
visibility:
'CORE4.EventBase:EventAggregator':
abstract: true
properties:
restrictToDocument:
type: boolean
ui:
label: 'Restrict to Document'
reloadIfChanged: TRUE
inspector:
group: 'aggregator'
prototype(CORE4.EventBase:EventList) >
prototype(CORE4.EventBase:EventList) < prototype(TYPO3.Neos:Content) {
templatePath = 'resource://CORE4.EventBase/Private/Templates/NodeTypes/EventList.html'
startNode = ${q(node).property('restrictToDocument') ? q(documentNode) : q(site)}
events = ${this.startNode.find('[instanceof CORE4.EventBase:Event]').future().orderEventsByDate('asc')}
hasEvents = ${this.events.count() > 0}
}
prototype(CORE4.EventBase:Event) >
prototype(CORE4.EventBase:Event) < prototype(TYPO3.Neos:Page) {
body {
templatePath = 'resource://CORE4.EventBase/Private/Templates/NodeTypes/Event.html'
sectionName = 'body'
content {
images = ContentCollection {
nodePath = 'images'
}
description = PrimaryContent {
@nezaniel
nezaniel / gist:22da6b211fd9cdd1af84
Created September 5, 2014 13:18
Attribute propagation in TS Prototypes
# Abstract Box
prototype(EA:Box) >
prototype(EA:Box) < prototype(TYPO3.Neos.NodeTypes:TextWithImage) {
targetNode = ${q(node).property('linkTarget')}
targetAudience = ${q(node).property('linkTarget')?q(this.targetNode).closest('[instanceof EA:TargetAudience]').get(0):NULL}
@override.targetAudienceIdentifier = ${q(node).property('linkTarget')?q(this.targetAudience).property('identifier'):'default'}
targetAudienceIdentifier = ${targetAudienceIdentifier}
attributes.class = ${'target-audience-' + targetAudienceIdentifier}
}
@override.searchResults = ${this.sortedSearchQuery.limit(20).execute()}
@override.zipLocation = ${request.arguments.zipCode ? Location.fromGermanPostalCode(request.arguments.zipCode) : NULL}
zipLocation = ${zipLocation}
searchQuery = ${Search.query(site).nodeType('ACME:ACME')}
sortedSearchQuery = ${this.searchQuery.sortGeoDistanceAsc('location', Location.latitude(this.zipLocation), Location.longitude(this.zipLocation), 'km')}
@nezaniel
nezaniel / gist:ff1408ffa3d99e3075b3
Last active August 29, 2015 14:21
Neos Backend xliff provider with configurable override
<?php
namespace TYPO3\Neos\Controller\Backend;
/* *
* This script belongs to the TYPO3 Flow package "TYPO3.Neos". *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU General Public License, either version 3 of the *
* License, or (at your option) any later version. *
* *
@nezaniel
nezaniel / TagBasedAssetListImplementation
Created August 12, 2016 09:18
A TagBasedAssetListImplementation for Neos TypoScript 2
class TagBasedImageListImplementation extends TemplateImplementation {
/**
* @Flow\Inject
* @var TagRepository
*/
protected $tagRepository;
/**
* @Flow\Inject
"asset": {
"type": "attachment",
"fields": {
"asset": {
"type": "string",
"term_vector":"with_positions_offsets",
"store": true
}
}
}
@nezaniel
nezaniel / php
Created February 22, 2017 10:20
<?php
namespace Neos\ContentRepository\EventSourced\Domain\Model\Content\Event;
/*
* This file is part of the Neos.ContentRepository.EventSourced package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this