Skip to content

Instantly share code, notes, and snippets.

@rpflamm
rpflamm / ForViewHelper
Created October 21, 2019 08:11
Own TYPO3 ForViewHelper for array shuffle function
<?php
namespace Vendor\Extension\ViewHelpers;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
class ForViewHelper extends AbstractViewHelper
{
@rpflamm
rpflamm / Controller.php
Created April 20, 2018 13:48
File Upload with TYPO3 8.7.13
<?php
namespace Vendor\MyExt\Controller;
class MyController extends ActionController
{
/**
* action create
*
* @param \Vendor\MyExt\Domain\Model\MyModel $myModel
<?php
namespace TGM\TgmLib\ViewHelpers;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* GetRecordViewHelper
@rpflamm
rpflamm / gist:9b71498079e0dc205d3e367fe774d8b1
Last active September 1, 2016 13:04
randomImage from Directory
lib.randomImages = COA
lib.randomImages {
10 = LOAD_REGISTER
10 {
images.cObject = FILES
images.cObject {
folders = 1:user_files/zufallsbilder/
renderObj = TEXT
renderObj {
@rpflamm
rpflamm / fluid.html
Created June 10, 2016 13:18
more link in teaser
<f:if condition="{newsItem.teaser}">
<f:then>
<span itemprop="description"><f:format.html>{newsItem.teaser -> f:format.crop(maxCharacters: '{settings.cropMaxCharacters}', respectWordBoundaries:'1')} <n:link newsItem="{newsItem}" settings="{settings}" class="more" title="{newsItem.title}"><f:translate key="more-link"/></n:link></f:format.html></span>
</f:then>
<f:else>
<span itemprop="description"><f:format.html>{newsItem.bodytext -> f:format.crop(maxCharacters: '{settings.cropMaxCharacters}', respectWordBoundaries:'1')} <n:link newsItem="{newsItem}" settings="{settings}" class="more" title="{newsItem.title}"><f:translate key="more-link"/></n:link></f:format.html></span>
</f:else>
</f:if>
@rpflamm
rpflamm / Index.html
Last active February 9, 2016 09:56
ShuffleViewHelper
{namespace ve=Vendor\Extension\ViewHelpers}
<f:for each="{yourArray -> ve:shuffle(limit:3)}" as="item">
{item.name}
</f:for>
@rpflamm
rpflamm / Doctrine_Query.diff
Created July 1, 2014 10:51
Try to reduce the joins for the sub propertys in #TYPO3Flow...
Index: flow/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Persistence/Doctrine/Query.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- flow/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Persistence/Doctrine/Query.php (revision )
+++ flow/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Persistence/Doctrine/Query.php (revision )
@@ -528,10 +528,14 @@
$propertyPathParts = explode('.', $propertyPath);
$conditionPartsCount = count($propertyPathParts);