По разработке на FLOW3, NEOS, extbase + fluid + fedex - и что там еще ООООчень хочется понять - как это выкглядит:
примерно так?
PHP код:
#
## Simple usage Example
#
tt_content.tx_contentdesigner_testElement < plugin.tx_contentdesigner
tt_content.tx_contentdesigner_testElement.settings {
# Element Title
title = Test
description = Sample Element of Plugin content designer
# Flexform Field Definitions
cObject {
# Define a Sheet
sTEMP {
sheetTitle = Dateneingabe
# Add Sheet Elements
el {
# Define a field just with flexform configuration
text {
label = Titel
config.type = text
}
# Any fieldname will be preset with the string tsc_ (so object will be tsc_object in renderObj)
object {
label = Select a Page
config {
type = group
internal_type = db
allowed = pages
size = 1
maxitems = 1
minitems = 0
show_thumbs = 0
}
}
}
}
}
# Frontend Rendering
renderObj {
20 = TEXT
20.field = text
20.wrap = <strong>|</strong><br>
30 = RECORDS
30 {
source.field = object
tables = pages
dontCheckPid = 1
conf.pages = TEXT
conf.pages.field = title
conf.pages.wrap = <span style="background-color: yellow;">|</span>
}
}
previewObj = COA
previewObj {
10 = TEXT
10.field = text
10.wrap = <p>|</p>
}
}
#
## Example how to load a FlexForm File
#
tt_content.tx_contentdesigner_flexTest < plugin.tx_contentdesigner
tt_content.tx_contentdesigner_flexTest.settings {
# Element Title
title = FlexTest
description = Test flexform file include experience
# Flexform Field Definitions
cObjectFlexFile = EXT:content_designer/Configuration/FlexForms/testfile.xml
# Frontend Rendering
renderObj.20 = TEXT
renderObj.20.field = test
renderObj.20.wrap = Your Selection: <strong>|</strong>
previewObj = COA
previewObj {
10 = TEXT
10.field = test
10.wrap = <p>|</p>
}
}
#
## Example how to make a another plugin to a ctype
#
#tt_content.tx_contentdesigner_youtube < plugin.tx_jhsimpleyoutube
#tt_content.tx_contentdesigner_youtube = USER
#tt_content.tx_contentdesigner_youtube {
# userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
#
# pluginName = Pi1
# extensionName = JhSimpleYoutube
# controller = VideoRenderer
# vendorName = TYPO3
#
# settings {
# title = YouTube
# description = Video integration
#
# icon = ../typo3conf/ext/content_designer/Resources/Public/MediaElementJS/ce_wiz.gif
# iconSmall = ../typo3conf/ext/content_designer/Resources/Public/MediaElementJS/ext_icon.gif
#
# cObjectFlexFile = EXT:jh_simple_youtube/Configuration/FlexForms/contentPlugin.xml
# }
#}
--------------------
PHP код:
plugin.tx_contentdesigner = USER
plugin.tx_contentdesigner {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
pluginName = Pi1
extensionName = ContentDesigner
controller = ContentRenderer
vendorName = KERN23
action = show
switchableControllerActions {
ContentRenderer {
1 = show
}
}
features {
// uncomment the following line to enable the new Property Mapper.
rewrittenPropertyMapper = 1
}
settings {
disableDefaultDrawItem = 0
renderObj = COA
renderObj.10 < tt_content.header
}
}
---------------
PHP код:
<?php
namespace KERN23\ContentDesigner\Controller;
/* * *************************************************************
* Copyright notice
*
* (c) 2013
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
* ************************************************************* */
/**
*
*
* @package nnhshpersonendaten
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*
*/
class ContentRendererController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
/**
* Shows a single item
*
*
* @return void
*/
public function showAction() {
// Modifies the Render Object
$this->cleanRenderObj($this->settings);
// Flex Data laden
$cObjAr = $this->settings['flexform'];
// Extra Felder laden
if ( sizeof($this->settings['cObjectStaticData.']) > 0 ) {
foreach ( $this->settings['cObjectStaticData.'] as $key => $val ) {
$cObjAr[$key] = $val;
}
}
// Content Object laden
$this->cObj = $this->configurationManager->getContentObject(); // Die original Daten zwischen speichern
// Content Data laden
$data = $this->cObj->data;
// Daten mergen
$this->cObj->start(array_merge($data,$cObjAr));
// Ausfuehren
$itemContent = \KERN23\ContentDesigner\Utility\TypoScript::parseTypoScriptObj($this->settings['renderObj'],$this->settings['renderObj.'],$this->cObj);
// Zurücksetzen
$this->cObj->start($data,'tt_content'); // Reset des CURRENT Wert damit die Content ID wieder eingefuegt werden kann
// Liefern
return $itemContent;
}
/**
* Normalize the Config Array
*
*
* @param array $settings
* @return void
*/
private function cleanRenderObj(&$settings) {
$this->settings['renderObj.'] = $this->settings['renderObj'];
$this->settings['renderObj'] = $this->settings['renderObj']['_typoScriptNodeValue'];
unset($this->settings['renderObj.']['_typoScriptNodeValue']);
$tsParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService');
$this->settings['renderObj.'] = $tsParser->convertPlainArrayToTypoScriptArray($settings['renderObj.']);
}
}