Skip to content

Instantly share code, notes, and snippets.

<?php
namespace FoobarCom\Site\Command;
use Neos\ContentRepository\Domain\Model\NodeInterface;
use Neos\Eel\FlowQuery\FlowQuery;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Cli\CommandController;
use Phlu\Corporate\Factory\ContextFactory;
@lorenzulrich
lorenzulrich / AssetCollectionConditionGenerator.php
Last active October 26, 2022 11:41
A custom privilege matcher to match asset collections whose title starts with a given string. This can be used to conditionally show/hide asset collections in the Media module. Please keep in mind that this does not prevent anyone from knowing the location of a certain file to download it. There are other solutions to ensuring files are only ser…
<?php
namespace Visol\FoobarCom\Security\Authorization\Privilege\Doctrine;
/*
* This file is part of the Neos.Media package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
<?php
namespace My\FoobarCom\Form\Validation;
/* *
* This script belongs to the TYPO3 Flow package "Neos.Form". *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License, either version 3 *
* of the License, or (at your option) any later version. *
@lorenzulrich
lorenzulrich / ConfirmationFinisher.php
Created January 10, 2022 13:40
Neos Form Builder Confirmation Finisher with Fluid
<?php
namespace Visol\FoobarCom\Form\Finishers;
use Neos\Flow\Annotations as Flow;
use Neos\FluidAdaptor\View\StandaloneView;
use Neos\Form\Core\Model\AbstractFinisher;
use Neos\Form\Exception\FinisherException;
use Neos\Utility\ObjectAccess;
From dfd8bbe308f92687b6bfc0096ebb58ddd7e593dd Mon Sep 17 00:00:00 2001
From: Andy Meier <andy.meier@visol.ch>
Date: Tue, 15 Dec 2020 12:53:59 +0100
Subject: [PATCH] [BUGFIX] wrong width and height properties taken from EXIF
(refs #20853)
---
Classes/Service/Extractor/MetaDataExtractor.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
<?php
/**
* This file is part of the "foobarsite" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*/
namespace Visol\Foobarsite\ViewHelpers;
@lorenzulrich
lorenzulrich / SetPropertyUsingEel.php
Created November 18, 2020 18:29
Custom SetPropertyUsingEel transformation for Neos CMS Node Migrations
<?php
namespace My\FoobarCom\Migration\Transformations;
use Neos\Flow\Annotations as Flow;
use Neos\ContentRepository\Domain\Factory\NodeFactory;
use Neos\ContentRepository\Domain\Service\ContextFactory;
use Neos\ContentRepository\Domain\Model\NodeData;
use Neos\ContentRepository\Migration\Transformations\AbstractTransformation;
use Neos\Eel\EelEvaluatorInterface;
@lorenzulrich
lorenzulrich / GetValueViewHelper.php
Created June 9, 2020 17:29
ViewHelper used to read the value of a current template variable.
<?php
namespace My\Site\ViewHelpers;
/*
* ### Variable: Get
*
* ViewHelper used to read the value of a current template
* variable. Can be used with dynamic indices in arrays:
*
@lorenzulrich
lorenzulrich / ElementConfigurationViewHelper.php
Last active August 16, 2019 08:30
In order to use frontend validation in a Neos.FormBuilder form, the properties "required", "maxlength" as well as the validators in use need to be evaluated to generate the respective attributes for validation. This ViewHelper implements some common validators and generates `data-` attributes for ParsleyJS (http://parsleyjs.org/).
<?php
namespace Acme\Site\ViewHelpers\Form\FrontendValidation;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Validation\Validator\AbstractValidator;
use Neos\Flow\Validation\Validator\AlphanumericValidator;
use Neos\Flow\Validation\Validator\EmailAddressValidator;
use Neos\Flow\Validation\Validator\IntegerValidator;
use Neos\Flow\Validation\Validator\NotEmptyValidator;
@lorenzulrich
lorenzulrich / BgSetUsage.html
Last active November 14, 2018 21:00
ResponsiveImageViewHelper and SrcSetViewHelper for Responsive Images using lazysizes/bgset
<div class="lazyload" data-bgset="{v:srcSet(image: media.1, ratio: 1, maxWidth: 1920)}">
Foo
</div>
{namespace v=Visol\Foobar\ViewHelpers}