Skip to content

Instantly share code, notes, and snippets.

View mneuhaus's full-sized avatar

Marc Neuhaus mneuhaus

View GitHub Profile
<?php
namespace TYPO3\Expose\TypoScriptObjects;
/* *
* This script belongs to the TYPO3 Flow package "TYPO3.Expose". *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License, either version 3 *
* of the License, or (at your option) any later version. *
* *
<f:for each="{results}" as="result">
{result.foo}
<f:else>No results found</f:else>
</f:for>
vs
<f:if condition="{results}">
<f:then>
No results found
@mneuhaus
mneuhaus / FooController.php
Created October 2, 2013 14:18
TYPO3 CMS Frontend Plugin
<?php
namespace Company\ExtensionName\Controller;
/***************************************************************
* Copyright notice
*
* (c) 2013 Marc Neuhaus <apocalip@gmail.com>, Famelo OHG
*
* All rights reserved
*
@mneuhaus
mneuhaus / 0_reuse_code.js
Created October 2, 2013 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mneuhaus
mneuhaus / gist:6714516
Created September 26, 2013 13:51
don't you hate navigation the commandline by cd .. ? here are a few shorter aliases for jumping back:
alias ..='cd ../../'
alias ...='cd ../../../'
alias ....='cd ../../../../'
alias .....='cd ../../../../../'
alias ......='cd ../../../../../../'
@mneuhaus
mneuhaus / Uploads.html
Created September 26, 2013 13:42
This is a little "hack" i used recently to render the default Uploads Content element using Fluid instead of TypoScript
<ul class="list-group">
<f:for each="{files}" as="file">
<li class="list-group-item">
<a href="{file.publicUrl}" >
<img src="typo3/gfx/fileicons/{file.extension}.gif" />
{file.name}
</a>
</li>
</f:for>
</ul>
<?php
/**
* @Flow\Inject
* @var \TYPO3\Flow\Mvc\Routing\Router
*/
protected $router;
function getRoute($request) {
$this->router->route($request->getHttpRequest());
$route = $this->router->getLastMatchedRoute();
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript">
window.onresize = function(){
var agent = navigator.userAgent;
var current_width = window.innerWidth;
var html = document.getElementsByTagName('html')[0];
if (agent.match(/Android.*Mobile|BlackBerry|iPhone|iPod|Opera Mini|IEMobile/i)) {
-
requestFilter: 'isPackage("Package1.Features")'
options:
layoutRootPathPattern: resource://Famelo.ADU/Private/Layouts/
templatePathAndFilename: resource://Famelo.ADU/Private/Templates/Features/Index.html
-
name: 'Home'
uriPattern: ''
defaults:
'@package': 'Famelo.Brain'
'@controller': 'Standard'
'@action': 'index'
'@format': 'html'
appendExceedingArguments: true