Skip to content

Instantly share code, notes, and snippets.

View mficzel's full-sized avatar

Martin Ficzel mficzel

  • sitegeist neos solutions GmbH
  • Germany, Hamburg
View GitHub Profile
@mficzel
mficzel / gist:6622101
Created September 19, 2013 11:31
Create and use a custom-logger in TYPO3.Flow
//create logger
$this->logger = \TYPO3\Flow\Log\LoggerFactory::create('myLoggerName', 'TYPO3\Flow\Log\Logger', '\TYPO3\Flow\Log\Backend\FileBackend', array(
'logFileURL' => FLOW_PATH_DATA . 'Logs/myLoggerName.log',
'createParentDirectories' => TRUE,
'severityThreshold' => LOG_INFO,
'maximumLogFileSize' => 10485760,
'logFilesToKeep' => 1,
'logIpAddress' => TRUE
));
@mficzel
mficzel / gist:3b2333429c3b31622f2a
Created February 11, 2015 10:16
Language fallback message in TYPO3.Neos
<f:if condition="{node.context.targetDimensions.language} != {node.dimensions.language.0}">
The language fallback is active.
</f:if>
@mficzel
mficzel / IdeaStructuralEditing.md
Last active April 4, 2016 07:48
Neos Structural Editing

Neos Structural Editing

Thesis: Structural Editing is like SquelPro on the NodeData-Table with the knowledge of NodeTypes, Pathes, Dimensions, Workspaces and Constraints

Example use cases:

  • show all news documents below node xxx as a table
  • show all children of node

Structural Editing is included as an alternative to the Content Module for a site and can be used to handle and structure content that is not necessary a website.

@mficzel
mficzel / CustomTypeValidation.md
Last active April 20, 2016 13:22
Add CustomTypes to Config Validation

CustomSchema Types

The schema-validation is limited by the current predefined structure. On the other hand the schema files could be a very important source of documentation.

ExampleData:

items:
  foo:
    itemType: 'type1'
    option1: 'option required for type 1'
@mficzel
mficzel / Controller.php
Last active April 29, 2016 19:35
multiple file upload in flow-framework
public function initializeUploadAction()
{
if ($this->request->getParentRequest()->hasArgument('uploadFiles')) {
$uploadFiles = $this->request->getParentRequest()->getArgument('uploadFiles');
$resources = [];
foreach ($uploadFiles as $uploadFile) {
$resource = ['tmp_name' => $uploadFile['tmp_name'], 'name' => $uploadFile['name']];
$newResource = $this->resourceManager->importUploadedResource($resource);
$resources[] = $newResource;
}
@mficzel
mficzel / OverrideFusionCollections.fusion
Last active January 22, 2018 10:32
Fusion Node Mapping
#
# ATTENTION UNTESTED PSEUDO-CODE TO SHOW THE PRINCIPLE IDEA
#
# THIS DOES NOT WORK YET
#
prototype(Neos.Fusion:RawCollection) {
// store __node reference in the rendered result
// if item is a node and the value is an array
itemRenderer.@process.addNodeReference {
@mficzel
mficzel / CollectionMapping.fusion
Last active February 5, 2018 10:48
Atomic.Fusion Collection Mapping :: Discussion of options
// Given the Neos.Fusion:Collection will iterate over the items that are given as array.
// If a ContentCollection is rendered and the nodes shall be edited inline the information
// wich node is rendererd has to be transferred to the collection whild keeping then interface
// of the component simple and serializable.
//
// This document discusses some of the possible syntax options.
//
// Automagic RawCollection
//
@mficzel
mficzel / PreviewPrototypeImplementation.php
Last active May 25, 2018 16:31
Optimized PreviewPrototypeImplementation
<?php
namespace Sitegeist\Monocle\FusionObjects;
/*
* This file is part of the Neos.Fusion 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
@mficzel
mficzel / Pagination_simple.fusion
Last active October 22, 2018 13:38
AFX Pagination
#
# simple pagination with parameter appending to a uri
#
prototype(Vendor.Site:Components.Molecules.Pagination) < prototype(PackageFactory.AtomicFusion:Component) {
@styleguide {
title = 'Pagination'
props {
current = 12
start = 8
end = 16
@mficzel
mficzel / example.fusion
Created November 16, 2018 14:12
Examples for Neos.Fusion:Reduce
sum = Neos.Fusion:Reduce {
items = ${ __array_of_products__ }
initialValue = 0
itemReducer = ${carry + item.price}
}
cheapest = Neos.Fusion:Reduce {
items = ${ __array_of_products__ }
initialValue = null
itemReducer = ${(!carry || carry.price > item.price) ? item : carry}