Skip to content

Instantly share code, notes, and snippets.

@aertmann
aertmann / FindOperation.php
Created March 6, 2014 11:49
Find operation with recursive filtering support and identifier support. Fallback of https://review.typo3.org/#/q/status:open+topic:find-operation,n,z for Neos 1.0. Usage: ${q(site).find('[instanceof TYPO3.Neos.NodeTypes:Text]')} // ${q(site).find('#60216562-0ad9-86ff-0b32-7b7072bcb6b2')}
<?php
namespace Moc\Net\TypoScript\FlowQueryOperations;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Eel\FlowQuery\FlowQuery;
use TYPO3\TYPO3CR\Domain\Repository\NodeDataRepository;
/**
* Override the built in Neos PropertyOperation so the operation can take a default value
*/
@aertmann
aertmann / Settings.yaml
Created March 25, 2014 15:07
Content dimension configuration
contentDimensions:
dimensions:
locales:
defaultPreset: all
icon: 'icon-language'
presets:
all:
routePart: 'intl'
label: 'All languages'
values: [mul_ZZ]
TYPO3:
Neos:
contentDimensions:
dimensions:
'locales':
defaultPreset: 'all'
label: 'Locale'
icon: 'icon-language'
position: 100
presets:
You can do it with a simple template object. Here's an example:
contentMenu = TYPO3.TypoScript:Template {
templatePath = 'resource://Moc.Net/Private/Templates/TypoScriptObjects/ContentMenu.html'
items = ${q(node).children('[instanceof TYPO3.Neos:ContentCollection]').children('[instanceof Moc.Net:SectionGrid][showInContentMenu = true]')}
}
{namespace moc=Moc\Net\ViewHelpers}
<f:if condition="{items}">
<ul>
# If object
page.htmlTag.attributes.style = TYPO3.TypoScript:If {
condition = ${q(node).property('image')}
then = TYPO3.TypoScript:ResourceUri {
resource = ${q(node).property('image').resource}
@process.wrap = ${"background-image: url('" + value + "');"}
}
}
@aertmann
aertmann / .gitignore
Last active August 29, 2015 14:02
Git ignore file for versioning without individual site package repository
/Build/Behat/*
/Build/BuildEssentials
/Build/Reports
/Build/Resources
/Data/
/Packages/
/Web/
/bin/
/Readme.txt
/Upgrading.txt
@aertmann
aertmann / Debugger.php
Created June 27, 2014 19:20
Improve debugging TYPO3CR nodes.. Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Error/Debugger.php
static protected $blacklistedClassNames = '/
(TYPO3\\\\Flow\\\\Aop.*)
(TYPO3\\\\Flow\\\\Cac.*) |
(TYPO3\\\\Flow\\\\Core\\\\.*) |
(TYPO3\\\\Flow\\\\Con.*) |
(TYPO3\\\\Flow\\\\Http\\\\RequestHandler) |
(TYPO3\\\\Flow\\\\Uti.*) |
(TYPO3\\\\Flow\\\\Mvc\\\\Routing.*) |
(TYPO3\\\\Flow\\\\Log.*) |
(TYPO3\\\\Flow\\\\Obj.*) |
<?php
namespace MOC\...\ViewHelpers\Form;
/**
* The form checkbox select view helper
*
* @scope prototype
*/
class CheckboxSelectViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper {
###
# RSS Feed for articles
###
-
name: 'RSS Feed (page)'
uriPattern: '{node}/rss.xml'
routeParts:
'node':
handler: 'TYPO3\Neos\Routing\FrontendNodeRoutePartHandlerInterface'
defaults:
@aertmann
aertmann / README.md
Last active August 29, 2015 14:11
Slugify helpers

View helper usage:

{a=Aertmann\Acme\ViewHelpers}
<div id="{node.properties.title -> a:slugify()}"></div>

Eel helper usage:

slug = ${String.slugify(q(node).property('title'))}