Skip to content

Instantly share code, notes, and snippets.

View sorenmalling's full-sized avatar

Søren Malling sorenmalling

View GitHub Profile
http://wiki.typo3.org/Pagetree#Context_menu
options.contextMenu {
table.pages.items {
710 = ITEM
710 {
name = notInMenu
label = Hide in menu
icon = ' . t3lib_div::locationHeaderUrl(t3lib_extMgm::extRelPath($_EXTKEY) . 'ext_icon.gif') . '
spriteIcon =
@sorenmalling
sorenmalling / Plugin Schema.json
Created December 13, 2012 17:56
TYPO3 Neos Plugin
# Plugins schema
{
"TYPO3.Blog:BlogPlugin": {
"pluginViews": {
"PostDetails": {
"controllerActions": {
"CommentController": [
"create",
"delete"
],
@sorenmalling
sorenmalling / Account.php
Last active December 10, 2015 08:08
TYPO3 Flow: Extending Person for my own account
<?php
namespace Teamwork\Teamwork\Domain\Model;
/* *
* This script belongs to the TYPO3 Flow package "Teamwork.Teamwork". *
* *
* */
use TYPO3\Flow\Annotations as Flow;
use Doctrine\ORM\Mapping as ORM;
<form action="save.php" method="POST">
<input type="hidden" name="element-uid" value="[tt_content_uid]" />
<textarea>Here goes comment - this could be a RTE</textarea>
</form>
@sorenmalling
sorenmalling / gist:5421328
Created April 19, 2013 16:04
Gravatar with TypoScript
10 = COA
10 {
10 = TEXT
10 {
value = http://www.gravatar.com/avatar/
}
20 = TEXT
20 {
value = soren.malling@gmail.com
hash = md5
renderObj = COA
renderObj {
wrap = <ul>|</ul>
1 = TEXT
1 {
wrap = <li>|</li>
typolink {
parameter.field = link
}
field = title
➜ Desktop ls -l CenterSjaelland
total 416
-rw-r--r--@ 1 sorenmalling staff 1866 29 Maj 08:10 README.md
-rw-r--r--@ 1 sorenmalling staff 55364 29 Maj 08:10 apple-touch-icon-precomposed.png
-rw-r--r--@ 1 sorenmalling staff 55364 29 Maj 08:10 apple-touch-icon.png
-rw-r--r--@ 1 sorenmalling staff 102 29 Maj 08:10 bower.json
-rw-r--r--@ 1 sorenmalling staff 1205 29 Maj 08:10 config.rb
drwxr-xr-x 4 sorenmalling staff 136 29 Maj 08:10 css
-rwxr-xr-x@ 1 sorenmalling staff 25848 29 Maj 08:10 demo.html
-rw-r--r--@ 1 sorenmalling staff 39096 29 Maj 08:10 facebook.jpg
@sorenmalling
sorenmalling / hook.php
Created July 11, 2013 10:08
A modified TCA field ("group") followed by indexing 'config' => array( 'type' => 'group', 'size' => '30', 'internal_type' => 'file', 'allowed' => 'jpg,png,gif,bmp,tiff,tif', 'disable_controls' => 'browser,list,delete', 'maxitems' => 999, 'uploadfolder' => 'fileadmin/gallerier' ) causing the following exception "Cannot add a file that is already …
$uploadFolder = $GLOBALS['TCA'][$table]['columns']['fileupload']['config']['uploadfolder'];
$uploadedImages = explode(',', $fieldArray['fileupload']);
/** @var $fileCollectionRepository TYPO3\CMS\Core\Resource\FileCollectionRepository */
// $fileCollectionRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileCollectionRepository');
// $fileCollectionObject = $fileCollectionRepository->findByUid($id);
/** @var $fileFactory \TYPO3\CMS\Core\Resource\ResourceFactory */
$fileFactory = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
/** @var $indexerService \TYPO3\CMS\Core\Resource\Service\IndexerService */
$indexerService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\Service\\IndexerService');
function processDatamap_postProcessFieldArray ($status, $table, $id, &$fieldArray, $parentObject) {
if($table == 'sys_file_collection' && in_array($status, array('update', 'new'))) {
if(array_key_exists('uploadfile', $fieldArray)) {
$uploadFolder = $GLOBALS['TCA'][$table]['columns']['uploadfile']['config']['uploadfolder'];
$uploadedImages = explode(',', $fieldArray['uploadfile']);
unset($fieldArray['uploadfile']); // Don't want it to get persistsed as it serves a dummy
/** @var $fileCollectionRepository TYPO3\CMS\Core\Resource\FileCollectionRepository */
$fileCollectionRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileCollectionRepository');
$fileCollectionObject = $fileCollectionRepository->findByUid($id);
@sorenmalling
sorenmalling / realurl_autoconf.php
Last active December 24, 2015 01:39
Baisc TYPO3 Realurl configuration
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array (
'_DEFAULT' =>
array (
'init' =>
array (
'enableCHashCache' => true,
'appendMissingSlash' => 'ifNotFile,redirect',
'adminJumpToBackend' => true,
'enableUrlDecodeCache' => true,