Skip to content

Instantly share code, notes, and snippets.

@mhuber84
mhuber84 / PageRowDescriptionHook.php
Last active March 18, 2020 20:25
Show page's description (page.rowDescription) in the TYPO3 backend page module (based on EXT:sys_note)
<?php
namespace MyVendor\MyTheme\Hook;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
use TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper;
class PageRowDescriptionHook
{
@mhuber84
mhuber84 / .htaccess
Created February 14, 2017 08:29
Set download filename to pre last path segment
<IfModule mod_headers.c>
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} ([^/]+)/datasheet.pdf$
RewriteRule ^.*$ - [E=DATASHEETNAME:%1]
RequestHeader set datasheetname "%{DATASHEETNAME}e" env=DATASHEETNAME
Header set Content-Disposition "attachment; filename=%{HTTP_DATASHEETNAME}e.pdf" env=HTTP_DATASHEETNAME
</IfModule>
</IfModule>
@mhuber84
mhuber84 / MenuUtility.php
Last active October 18, 2018 03:10
Set USERDEF1 (or USERDEF2) in a language menu on record detail pages if the record is not translated. #TYPO3
<?php
namespace BGM\BgmTheme\Utility;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
@mhuber84
mhuber84 / test.md
Last active September 12, 2016 15:07
TYPO3 language handling and starttime/stoptime test (https://forge.typo3.org/issues/76974)

Because we had some issues with language handling and starttime/stoptime, I made some tests with different configurations and TYPO3 versions. These are the results, perhaps they are usefull for someone else, too.

Configuration 1

### TypoScript:
config.sys_language_overlay = 0
config.sys_language_mode = strict

### Page-TsConfig:
@mhuber84
mhuber84 / ImagesToFalUpdateWizard.php
Last active May 25, 2016 17:24
Upgrade Images to FAL-Images in EXT:ws_flexslider 1.4
<?php
namespace WapplerSystems\WsFlexslider\Updates;
/**
* Upgrade wizard that moves all images (usually in uploads/tx_wsflexslider)
* to the default storage (usually fileadmin/_migrated/tx_wsflexslider/)
* and also updates the according fields (e.g. tx_wsflexslider_domain_model_image:123:image) with the new string, and updates
* the softreference index
* Based on \TYPO3\CMS\Install\Updates\RteMagicImagesUpdateWizard
*
@mhuber84
mhuber84 / AdditionalConfiguration.php
Created January 13, 2015 18:39
TYPO3 Surf deployment for TYPO3 CMS with one target node and getting the database and files from another server
<?php
$GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword'] = '$P$CEF2NP3kCoIHwDupr8RiYUMQ7/Rp.j.';
$GLOBALS['TYPO3_CONF_VARS']['DB']['database'] = 'projects_my_onenodeintegration';
$GLOBALS['TYPO3_CONF_VARS']['DB']['username'] = 'user';
$GLOBALS['TYPO3_CONF_VARS']['DB']['password'] = 'secret';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] = 'My OneNode Integration';
@mhuber84
mhuber84 / AdditionalConfiguration.php
Last active August 29, 2015 14:03
TYPO3 Surf deployment for TYPO3 CMS with 4 target nodes
<?php
$GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword'] = '$P$CEF2NP3kCoIHwDupr8RiYUMQ7/Rp.j.';
$GLOBALS['TYPO3_CONF_VARS']['DB']['database'] = 'projects_my_multiplenodes';
$GLOBALS['TYPO3_CONF_VARS']['DB']['username'] = 'user';
$GLOBALS['TYPO3_CONF_VARS']['DB']['password'] = 'secret';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] = 'My MultipleNodes';
@mhuber84
mhuber84 / AdditionalConfiguration.php
Last active January 28, 2016 13:57
TYPO3 Surf deployment for TYPO3 CMS with one target node
<?php
$GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword'] = '$P$CEF2NP3kCoIHwDupr8RiYUMQ7/Rp.j.';
$GLOBALS['TYPO3_CONF_VARS']['DB']['database'] = 'projects_my_onenode';
$GLOBALS['TYPO3_CONF_VARS']['DB']['username'] = 'user';
$GLOBALS['TYPO3_CONF_VARS']['DB']['password'] = 'secret';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] = 'My OneNode';