Skip to content

Instantly share code, notes, and snippets.

View benjaminrau's full-sized avatar

Benjamin Rau benjaminrau

View GitHub Profile
@benjaminrau
benjaminrau / gist:6231856
Created August 14, 2013 14:59
FCE to create twitter bootstrap-conform sub-content areas with a dynamic number of columns and column widths
{namespace flux=Tx_Flux_ViewHelpers}
<f:layout name="Content"/>
<f:section name="Configuration">
<flux:flexform wizardTab="PRISMA" id="dynamicgrid" label="Dynamisches Grid">
<flux:flexform.section name="columns" label="Spalten">
<flux:flexform.object name="column" label="Spalte">
<flux:flexform.field.select name="columnClass" label="Spaltenbreite" items="span1,span2,span3,span4,span5,span6,span7,span8,span9,span10,span11,span12" maxItems="1" />
</flux:flexform.object>
</flux:flexform.section>
<flux:flexform.grid>
@benjaminrau
benjaminrau / Appendixes.html
Last active December 21, 2015 13:08
FCE to create a linklist with possibilty to choose how target is defined (internal by Page, external by url and filereferences with download) Also Solution for a downloadAction to serve files for download through a controllerAction
{namespace flux=Tx_Flux_ViewHelpers}
{namespace v=Tx_Vhs_ViewHelpers}
{namespace w=Tx_Fluidwidget_ViewHelpers}
<f:layout name="Content"/>
<f:section name="Configuration">
<flux:flexform id="appendixes" label="Appendixes" wizardTab="PRISMA">
<flux:flexform.section name="appendixes" label="Anhänge / Verweise">
<flux:flexform.object name="appendix" label="Anhang / Verweis">
<flux:flexform.field.select name="linkType" label="Verweistyp" items="{page:'Interner Verweis',url:'Externer Verweis beginnend mit http://',filereference:'Dateianhang'}"></flux:flexform.field.select>
<flux:flexform.field.select name="linkIcon" label="Link Icon" items="{0:'kein Icon',calendar:'Kalender',bubble:'Sprechblase'}"></flux:flexform.field.select>
@benjaminrau
benjaminrau / Powermail Plugin Settings
Last active December 30, 2015 22:06
Dynamic recipients for powermail with powermail field defined via typscript and fallback for recipient when no recipient is defined
Create a Hidden Form Field named recipient
Define Recipient Email as: {f:cObject(typoscriptObjectPath:'lib.receiveremail')}
Define Recipient Name as: {f:cObject(typoscriptObjectPath:'lib.receivername')}
@benjaminrau
benjaminrau / EventController.php
Last active December 21, 2015 21:19
View to serve ics files for events as download (vevent)
/**
* Init ICalendar Action
* Set Format to ICS
*/
public function initializeICalendarAction() {
$this->request->setFormat('ics');
}
/**
* action iCalendar
@benjaminrau
benjaminrau / SingletonInterface.php
Created August 28, 2013 22:35
With the if clause the error below doesnt occur! Fatal error: Cannot redeclare class TYPO3\CMS\Core\SingletonInterface in /Users/benjaminrau/Dropbox/codearts/Kunden/Interwall/prisma/htdocs/typo3/sysext/core/Classes/SingletonInterface.php on line 38
$declaredInterfaces = get_declared_interfaces();
if (FALSE === array_search('TYPO3\CMS\Core\SingletonInterface', $declaredInterfaces)) {
interface SingletonInterface {
}
}
@benjaminrau
benjaminrau / Controller.php
Last active October 10, 2019 13:07
Fill ObjectStorage from QueryResult
$objectStorage = $this->fillOjectStorageFromQueryResult($this->myRepository->findAll()));
/**
* Fill objectStorage from QueryResult
*
* @param \TYPO3\CMS\Extbase\Persistence\QueryResultInterface $queryResult
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
*/
protected function fillOjectStorageFromQueryResult(\TYPO3\CMS\Extbase\Persistence\QueryResultInterface $queryResult=NULL) {
@benjaminrau
benjaminrau / View.html
Created September 11, 2013 07:53
ViewHelpers with Namespaces
{namespace p=Codearts\Prisma\ViewHelpers}
{p:transformToType(value:settings.vpimage,dataType:'Codearts\Vpimages\Domain\Model\Image')->v:var.set(name:'vpimage')}
@benjaminrau
benjaminrau / Query.php
Created September 17, 2013 14:00
Set Orderings for an IN Statement
$query = $this->createQuery();
$results = $query->matching($query->in('objectProfile.geoLocation', $geoLocations));
# Sort by distance
if($geoLocations) {
foreach($geoLocations AS $geoLoc) {
$key = 'objectProfile.geoLocation = '.$geoLoc->getUid();
$orderings[$key] = Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING;
}
$results = $results->setOrderings($orderings);
@benjaminrau
benjaminrau / gist:6682246
Created September 24, 2013 09:10
Insert Asset if it current PageUid is not contained in settings.pagesToExclude. settings.pagesToExclude is a comma-separated list of PageUids like "1,5,6"
{v:page.info()->v:var.set(name:'currentPage')}
{settings.pagesToExclude->v:iterator.explode()->v:var.set(name:'pagesToExcludeArr')}
<f:if condition="{v:if.iterator.contains(needle:currentPage.uid,haystack:pagesToExcludeArr)->v:if.var.isNull()}">
<v:asset.script name="test"></v:asset.script>
</f:if>
@benjaminrau
benjaminrau / Snippet.html
Created September 25, 2013 13:19
ChunkViewHelper Usage
Expected html markup:
<div class="container1">
<a>1. Link</a>
<a>2. Link</a>
<a>3. Link</a>
<a>4. Link</a>
<a>5. Link</a>
</div>
<div class="container2">
<a>6. Link</a>