Skip to content

Instantly share code, notes, and snippets.

View mneuhaus's full-sized avatar

Marc Neuhaus mneuhaus

View GitHub Profile
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
{namespace flux=FluidTYPO3\Flux\ViewHelpers}
<f:layout name="Content" />
<f:section name="Configuration">
<flux:form wizardTab="Inhaltselemente" id="grid176617" options="{useTypoScript: 0}" label="Grid: 17-66-17">
<flux:grid>
<flux:grid.row>
<flux:grid.column style="width: 17%;border-right: 1px dotted #999;" name="column1" label="Spalte 1" />
@mneuhaus
mneuhaus / 1_Intro.md
Last active August 29, 2015 14:07
Famelo.Soul: a flexible controller flow with a persistent state for TYPO3.Flow

Combinations of Controllers/Actions that span wider than 2-3 Actions are simple to code, but often result in extremely rigid and unflexible structures that are not easily extendable or modularized. The biggest example is for example a User Registration, this kind of process varies quite extremely in any kind of project. Some times it's enough to have a simple form + e-mail verification, sometimes you need a quite complex process with verification, invoicing, reviewing, etc. Currently it's often necessary to reimplement various of this things from the ground up.

I've been toying with a basic concept for a while in my head which could be shortly described as combination of controllers/actions that are tied together by conditions through a settings.yaml which share and manipulate a state that's automatically persisted.

###Terminology

Soul: The Soul is an entity containing the current state of the process Fragment: a Fragment is

{namespace flux=FluidTYPO3\Flux\ViewHelpers}
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
{namespace t=Tx_Template_ViewHelpers}
<f:layout name="Content" />
<f:section name="Configuration">
<flux:form wizardTab="Inhaltselemente" id="references" label="Referenzen">
<flux:grid>
<f:for each="{elements}" as="element" iteration="iteration">
<f:for each="{element}" key="elementType" as="elementData">
{namespace flux=FluidTYPO3\Flux\ViewHelpers}
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
<f:layout name="Content" />
<f:section name="Configuration">
<flux:form wizardTab="Inhaltselemente" id="textWithImage" label="Text mit Bild">
<flux:field.file name="file" label="Bild"/>
<flux:field.text name="header" label="Überschrift" rows="2"/>
<flux:field.text name="description" label="Beschreibung" rows="5" enableRichText="TRUE" />
<flux:field.input name="target" label="Verknüpfung">
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
{namespace flux=FluidTYPO3\Flux\ViewHelpers}
<f:layout name="Content" />
<f:section name="Configuration">
<flux:form id="grid3" options="{useTypoScript: 0}" label="Grid: 50-50">
<flux:grid>
<flux:grid.row>
<flux:grid.column style="width: 50%;border-right: 1px dotted #999;" name="column1" label="Spalte 1" />
@mneuhaus
mneuhaus / gist:21a8396235b6f9e437d8
Created October 15, 2014 09:13
teaser subpages in wordpress
<?php
$loop = new WP_Query( array( 'post_type' => 'page', 'orderby' => 'title', 'order'=>'ASC','posts_per_page' => 99, 'post_parent' => get_the_ID()) );
while ( $loop->have_posts() ) : $loop->the_post();
...
endwhile;
?>
@ci-stepper-height: 40px;
@ci-stepper-arrow-width: 20px;
@ci-stepper-arrow-width-mobile: 10px;
@ci-stepper-padding: 20px;
@ci-stepper-mobile-active-width: 0.6;
@ci-staged-stepper-height: 58px;
.ci-make-nav-stepper(@columns) {
margin: 0 0;

This gist is a collection of classes and configurations that enable to have an entity as a "persistent" context in multiple controllers.

  • ClientRoutePartHandler.php + Routes.yaml: these to handle the conversion of the route
  • ClientContextAware.php: identifies a controller to be ClientContextAware
  • ClientArgumentAspect.php: checks if the current controller ist ClientContextAware and adds the argument client to any url that is build without manual intervention
  • ClientContext.php: fetches the current client as a context, you can inject this class into anything where you might need the client to work with inside a ClientContextAware Controllercall.
  • Package.php: Injects the current Request into the ClientContext

Example

<?php
class...{
/**
* @Flow\Inject(setting="tagAttributes", package="TYPO3.Fluid")
* @var array
*/
property $tagAttributes;
@mneuhaus
mneuhaus / Example.php
Created August 5, 2014 15:08
GenerateValueListener
<?php
namespace Famelo\Saas\Domain\Model;
use Doctrine\ORM\Mapping as ORM;
use TYPO3\Flow\Annotations as Flow;
/**
* @Flow\Entity
*/
class Example {
/**