Ich versuche meine TS conf mit der flexform conf zu syncronisieren
$flex2conf = array(
'view' => 'sDEF:view',
);// Mapping array for PI flexform
$this->pi_initPIflexForm();// Init flexform configuration of the plugin
$piFlexForm = array();
$piFlexForm = $this->cObj->data['pi_flexform'];// Get flexform informations
$aConf = $this->api->fe_mergeTSconfFlex($flex2conf,$conf,$piFlexForm);// Ovverride TS setup with flexform
Als Ausgabe erhalte ich allerdings eine komplett weiße Seite auch alle Elemente die sonst auf der Seite sind sind weg. Der Quellcode der Seite ist einfach komplett leer sobald ich die Funktion verwende.
Ok das führe ich mir gerade mal zu Gemüte.
"Ich habe keine Ahnung, was bei dir $this->api ist"
Da liegt wohl logischerweise mein Fehler. ich bin da in irgend ner Developer api gelandet und hab gedacht das gehört zum typo3 core... #paralyzed#
http://typo3.org/documentation/document-library/extension-manuals/api_macmade/0.4.7/view/1/6/
Merke:
'$this->cObj->' != '$this->api->'
Bei mir sieht das so aus:
/**
* Read the flexform configuration and merge it with TS Setup config
*/
function getFlexformConfig() {
$this->pi_initPIflexForm();
$piFlexForm = $this->cObj->data['pi_flexform'];
foreach ($piFlexForm['data'] as $sheet => $data) {
foreach ($data as $lang => $value) {
foreach ($value as $key => $val) {
$v = $this->pi_getFFvalue($piFlexForm, $key, $sheet);
$this->conf[$key] = empty($v) ? $this->conf[$key] : $v;
}
}
}
}
nochmal danke an euch beide! aufgrund des Artikels wollte ich mir gerade genau so was von ammannd bauen.
Funktioniert! 😃
so ähnlich bei mir...
In der Hauptklasse:
$this->pi_initPIflexForm();
$this->div = t3lib_div::makeInstance('tx_ext_div');
$this->div->flex2conf($this);
In einer Nebenklasse (div):
/**
* Add flexform values to conf array
*
* @param array $pobj: Parent Object
* @return void
*/
public function flex2conf(&$pObj) {
if (is_array($pObj->cObj->data['pi_flexform']['data'])) { // if there are flexform values
foreach ($pObj->cObj->data['pi_flexform']['data'] as $key => $value) { // every flexform category
if (count($pObj->cObj->data['pi_flexform']['data'][$key]['lDEF']) > 0) { // if there are flexform values
foreach ($pObj->cObj->data['pi_flexform']['data'][$key]['lDEF'] as $key2 => $value2) { // every flexform option
if ($pObj->pi_getFFvalue($pObj->cObj->data['pi_flexform'], $key2, $key)) { // if value exists in flexform
$pObj->conf[$key.'.'][$key2] = $pObj->pi_getFFvalue($pObj->cObj->data['pi_flexform'], $key2, $key); // overwrite $conf
}
}
}
}
}
}
Vermutlich führen alle Wege nach Rom.
Wichtig: Während man den Werten aus typoscript trauen kann (darf nur der Admin ändern), kann man u.U. den Werten aus der Flexform nicht trauen (vom Redakteur)
einpraegsam.net schrieb
Wichtig: Während man den Werten aus typoscript trauen kann (darf nur der Admin ändern), kann man u.U. den Werten aus der Flexform nicht trauen (vom Redakteur)
finde ich eine wichtige anmerkung!!!