Create a gist now

Instantly share code, notes, and snippets.

@mneuhaus /Contact.html Secret
Last active Dec 10, 2016

Example file for the new outlet forms feature in flux: https://github.com/FluidTYPO3/flux/pull/1209#issuecomment-266240516
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
{namespace flux=FluidTYPO3\Flux\ViewHelpers}
<f:layout name="Content" />
<f:section name="Configuration">
<flux:form id="contact" options="{group: 'forms'}" label="Contactform">
<flux:field.input name="settings.recipient" label="Recipients" required="1" />
<flux:field.input name="settings.subject" label="E-Mail Subject" required="1" />
<flux:field.text name="settings.successMessage" label="Success Message" rows="2" />
<flux:outlet>
<flux:outlet.argument name="name">
<flux:outlet.validate type="NotEmpty" />
</flux:outlet.argument>
<flux:outlet.argument name="email">
<flux:outlet.validate type="NotEmpty" />
<flux:outlet.validate type="EmailAddress" />
</flux:outlet.argument>
<flux:outlet.argument name="message">
<flux:outlet.validate type="NotEmpty" />
</flux:outlet.argument>
<flux:pipe.email sender="marc@mia3.com" subject="{settings.subject}" recipient="{settings.recipient}" bodySection="EmailForAdmin" />
</flux:outlet>
</flux:form>
</f:section>
<f:section name="Main">
<f:form action="outlet" noCache="1">
<div>
<f:form.textfield name="name" class="form-control" placeholder="Name" value="{name}"/>
<f:if condition="{validationResults.name}">
<f:for each="{validationResults.name}" as="error">
<span class="error">{error.code}: {error.message}</span>
</f:for>
</f:if>
</div>
<div>
<f:form.textfield name="email" class="form-control" placeholder="E-Mail" value="{email}"/>
<f:if condition="{validationResults.email}">
<f:for each="{validationResults.email}" as="error">
<span class="error">{error.code}: {error.message}</span>
</f:for>
</f:if>
</div>
<div>
<f:form.textarea name="message" class="form-control" placeholder="Message" value="{message}" />
<f:if condition="{validationResults.message}">
<f:for each="{validationResults.message}" as="error">
<span class="error">{error.code}: {error.message}</span>
</f:for>
</f:if>
<button type="submit" class="btn btn-default pull-right">
Submit
</button>
</div>
</f:form>
</f:section>
<f:section name="OutletSuccess">
<h1>SUCCESS!</h1>
<p>
{settings.successMessage}
</p>
</f:section>
<f:section name="EmailForAdmin">
<h1>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</h1>
<p><strong>Pellentesque habitant morbi tristique</strong> senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, <code>commodo vitae</code>, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. <a href="#">Donec non enim</a> in turpis pulvinar facilisis. Ut felis.</p>
<h2>Header Level 2</h2>
<ol>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
<li>Aliquam tincidunt mauris eu risus.</li>
</ol>
<blockquote><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.</p></blockquote>
<h3>Header Level 3</h3>
<ul>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
<li>Aliquam tincidunt mauris eu risus.</li>
</ul>
<pre><code>
#header h1 a {
display: block;
width: 300px;
height: 80px;
}
</code></pre>
</f:section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment