Skip to content

Instantly share code, notes, and snippets.

View htuscher's full-sized avatar

Hans Tuscher htuscher

  • Everybody needs a Hans
  • Regensburg, Germany
  • 15:23 (UTC +02:00)
View GitHub Profile
@htuscher
htuscher / UrlCommandController.php
Last active July 31, 2018 12:03
Create frontend URIs from neos backend (CLI)
<?php
namespace Vendor\Site\Command;
use Vendor\Site\Service\SocialSharesService;
use TYPO3\Eel\FlowQuery\FlowQuery;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Cli\CommandController;
use TYPO3\Flow\Configuration\ConfigurationManager;
use TYPO3\Flow\Http\Request;
@htuscher
htuscher / IndexUserFunc.php
Last active August 31, 2017 12:09
TYPO3 Solr userFunc IndexQueue
<?php
namespace Vendor\Extension\Solr\UserFunc;
class IndexUserFunc
{
/**
* This value is automatically inserted by userFunc handling
* @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
*/
@htuscher
htuscher / Sections.html
Created November 7, 2015 14:44
FluidTYPO3 one-pager with sections
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"
xmlns:flux="http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers">
<f:layout name="Page" />
<f:section name="Configuration">
<!-- Make this page type configurable -->
@htuscher
htuscher / Observer.php
Last active November 17, 2015 16:05
TYPO3 Solr Extbase repository hook
<?php
/***************************************************************
* Copyright notice
*
* (c) 2015 Hans Höchtl <[email protected]>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@htuscher
htuscher / AbstractCommandController.php
Created November 27, 2015 08:02
TYPO3 Command Controller TypoScript from different rootPid
<?php
namespace Onedrop\Solution\Command;
/*****************************************************************
* Copyright notice
*
* (c) 2015 Hans Höchtl <[email protected]>
*
* All rights reserved
@htuscher
htuscher / LanguageMenu.ts2
Created February 23, 2016 10:33
Neos TypoScript2 condition LanguageMenu if dimension exists
languageMenu = TYPO3.Neos:DimensionMenu {
dimension = 'language'
templatePath = 'resource://Vendor.Package/Private/Templates/TypoScriptObjects/LanguageMenu.html'
@if.condition = ${Type.className(q(node).context({'dimensions': {'language': ['en']}, 'targetDimensions': {'language': 'en'}}).get(0)) == 'TYPO3\TYPO3CR\Domain\Model\Node'}
}
@htuscher
htuscher / ExtbaseForceLanguage.php
Last active August 29, 2023 11:04
TYPO3 Extbase get record with language different than FE or 0
<?php
namespace Onedrop\Common\Service;
/***************************************************************
* Copyright notice
*
* (c) 2015 Hans Höchtl <[email protected]>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
@htuscher
htuscher / Layout.html
Last active March 4, 2016 19:55
TYPO3 Flux render column in page menu
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
<f:layout name="Page" />
<v:page.menu entryLevel="0">
<ul class="nav-main">
<f:for each="{menu}" as="subPage" iteration="mainIteration">
<li class="{f:if(condition:'{subPage.hasSubPages}', then:'hassub')}{f:if(condition:'{mainIteration.isFirst}', then:' first')}{f:if(condition:'{mainIteration.isLast}', then:' last')} {subPage.navigation_layout}">
<f:link.page pageUid="{subPage.uid}">{subPage.title}</f:link.page>
</li>
<v:content.render column="3" pageUid="{subPage.uid}" />
@htuscher
htuscher / DfsHelper.php
Created June 14, 2016 12:00
Neos Menu DFS
<?php
namespace Onedrop\Manuals\TypoScript\Helper;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Eel\ProtectedContextAwareInterface;
use TYPO3\TYPO3CR\Domain\Model\NodeInterface;
/***************************************************************
* Copyright notice
*
@htuscher
htuscher / cleanup.sh
Created August 8, 2016 13:48
Cleanup docker engine
#!/bin/bash
docker rm -v $(docker ps -a -q -f status=exited)
docker rmi $(docker images -f "dangling=true" -q)
docker volume ls -qf dangling=true