Created
July 21, 2016 08:54
-
-
Save cedricziel/83c3077bd80fff00b28ce5490c7afb98 to your computer and use it in GitHub Desktop.
Neos CMS Plugin with inline-editable content areas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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, | |
] | |
); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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