Skip to content

Instantly share code, notes, and snippets.

@cedricziel
Created July 21, 2016 08:54
Show Gist options
  • Save cedricziel/83c3077bd80fff00b28ce5490c7afb98 to your computer and use it in GitHub Desktop.
Save cedricziel/83c3077bd80fff00b28ce5490c7afb98 to your computer and use it in GitHub Desktop.
Neos CMS Plugin with inline-editable content areas
prototype(Websight.Project:ContactFormPlugin) < prototype(TYPO3.Neos:Plugin)
prototype(Websight.Project:ContactFormPlugin) {
package = 'Websight.Project'
controller = 'ContactRequest'
action = 'new'
node = ${node}
titleLeft = ${q(node).property('titleLeft')}
titleRight = ${q(node).property('titleRight')}
textLeft = ${q(node).property('textLeft')}
}
<?php
namespace Websight\Project\Controller;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Error\Debugger;
use TYPO3\Flow\Mvc\Controller\ActionController;
use Websight\Project\Domain\Model\ContactRequest;
/**
* @package Websight\Project\Controller
*/
class ContactRequestController extends ActionController
{
/**
* @return void
*/
public function newAction()
{
$node = $this->request->getInternalArgument('__node');
$titleLeftProperty = $this->request->getInternalArgument('__titleLeft');
$titleRightProperty = $this->request->getInternalArgument('__titleRight');
$textLeftProperty = $this->request->getInternalArgument('__textLeft');
$this->view->assignMultiple(
[
'node' => $node,
'titleLeft' => $titleLeftProperty,
'titleRight' => $titleRightProperty,
'textLeft' => $textLeftProperty,
]
);
}
}
{namespace neos=TYPO3\Neos\ViewHelpers}
<f:layout name="Default"/>
<f:section name="Title">New contact request</f:section>
<f:section name="Content">
<div class="row">
<div class="col-md-4 col-sm-12 col-xs-12 center991">
{neos:contentElement.editable(property: 'titleLeft', tag: 'h3', class: 'text-center', node: node)}
{neos:contentElement.editable(property: 'textLeft', tag: 'address', class: 'addr1', node: node)}
</div>
<div class="col-md-8 col-xs-12">
{neos:contentElement.editable(property: 'titleRight', tag: 'h3', class: 'text-center', node: node)}
<f:form action="create" objectName="newContactRequest">
<!-- ... -->
</f:form>
</div>
</div>
</f:section>
'Websight.Project:ContactFormPlugin':
superTypes:
'TYPO3.Neos:Plugin': TRUE
ui:
label: 'Kontaktformular (Plugin)'
group: 'plugins'
properties:
titleLeft:
type: 'string'
ui:
inlineEditable: TRUE
aloha:
placeholder: 'Überschrift hier einfügen..'
textLeft:
type: 'string'
ui:
inlineEditable: TRUE
aloha:
placeholder: 'Text hier einfügen..'
titleRight:
type: 'string'
ui:
inlineEditable: TRUE
aloha:
placeholder: 'Überschrift hier einfügen..'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment