Skip to content

Instantly share code, notes, and snippets.

View bmoex's full-sized avatar

Benjamin Serfhos bmoex

View GitHub Profile
@bmoex
bmoex / TitleTagViewHelper.php
Last active September 11, 2019 09:01
The PageTitle API of TYPO3 CMS: how to use it in a ViewHelper?
<?php
namespace My\Extension\ViewHelpers;
use Closure;
use My\Extension\PageTitle\ViewHelperPageTitleProvider;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
@bmoex
bmoex / MenuProcessor.php
Created April 11, 2019 09:32
MenuProcessor that handle shortcuts for active/inactive state
<?php
namespace Your\Namespace\DataProcessing;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\Page\PageRepository;
/**
* Data Processor: Menu Processor
* Correctly define menu states for all possible types
@bmoex
bmoex / StoreInUrlCacheHook.php
Created April 25, 2018 10:57
Extend RealURL to store cHash when not already calculated
<?php
namespace Serfhos\RealurlCacheHashGeneration\Cache;
use DmitryDulepov\Realurl\Cache\UrlCacheEntry;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Page\CacheHashCalculator;
/**
* RealURL Hook: StoreInUrlCache
@bmoex
bmoex / MailFormDataUpdate.php
Last active April 26, 2019 10:48
Migration from "old" mailforms to "new" form extension
<?php
// Location: EXT:yourextension/Classes/Install/Updates/MailFormDataUpdate.php
namespace Serfhos\OldMailMigration\Install\Updates;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MailUtility;
/**
* Migrate "mailform" data to new 7.6 ext:form