Hi Typo-freunde,
im Backend gibt es das Menü "Content Element Wizard" bzw. "Neues
Inhaltselement", wenn man ein neues Contentelement anlegen will. Wenn
man das neue TemplaVoila installiert hat, gibt es in diesem Menü auch
einen Abschnitt "Flexible Seiteninhalte". Dort ist jedoch kein Eintrag
vorhanden.
Wie bekomme ich in dieses Menü meine selbst erstellten Flexible Content
Elemente hinein, damit man nicht mehr den Umweg über "Neues
Inhaltelement > Normaler Text > Selectorbox: Flexible Content Elements >
Save > Datenquelle auswählen > TemplateObject auswählen" gehen muss?
Jede Idee wäre hilfreich
Gruß,
Andy
okay,.. habs mittlerweile selber herraus gefunden...
es scheint wohl ein bug in typo3 selber zu sein.. man kann dies allerdings umgehen indem man folgendes macht:
Speichern folgendes PHP scripts z.b. unter
typo3conf/ext/templavoila/mod1/my_content_wizard.php
-----------------------------------------------------------------------
Einfügen der neuen Klasse in die Datei typo3conf/localconf.php
$TYPO3_CONF_VARS['BE']['XCLASS']['ext/templavoila/mod1/db_new_content_el.php']='my_content_wizard.php';
------------------------------------------------------------------------
<?php
class ux_tx_templavoila_dbnewcontentel extends tx_templavoila_dbnewcontentel {
function wizardArray() {
global $LANG, $TYPO3_DB;
$positionPid = $this->id;
$storageFolderPID = $this->getStorageFolderPid($positionPid);
$tTO = 'tx_templavoila_tmplobj';
$tDS = 'tx_templavoila_datastructure';
$res = $TYPO3_DB->exec_SELECTquery (
"$tTO.*",
"$tTO LEFT JOIN $tDS ON $tTO.datastructure = $tDS.uid",
"$tTO.pid=".intval($storageFolderPID)." AND $tDS.scope=2".t3lib_befunc::deleteClause ($tTO).t3lib_befunc::delete
Clause ($tDS)
);
$fce_count = 1;
$wizardItems = array();
$wizardItems['fce']['header'] = $LANG->getLL('fce');
while ($row = $TYPO3_DB->sql_fetch_assoc($res)) {
$tmpFilename = 'uploads/tx_templavoila/'.$row['previewicon'];
$wizardItems['fce_'.$fce_count]['icon'] = (@is_file(PATH_site.$tmpFilename)) ?('../'.$tmpFilename) : ('../'.t3lib_extMgm
::siteRelPath('templavoila').'res1/default_previewicon.gif');
$wizardItems['fce_'.$fce_count]['description'] = $row['description'] ? htmlspecialchars($row['description'])
: $LANG->getLL ('template_nodescriptionavailable');
$wizardItems['fce_'.$fce_count]['title'] = htmlspecialchars($row['title']);
$wizardItems['fce_'.$fce_count]['params'] = '&defVals[tt_content][CType]=templavoila_pi1&defVals[tt_content]
[tx_templavoila_ds]='.$row['datastructure'].'&defVals[tt_content][tx_templavoila_to]='.$row['uid'];
$fce_count ++;
}
return $wizardItems;
}
function getStorageFolderPid($positionPid) {
// Negative PID values is pointing to a page on the same level as the current.
if ($positionPid<0) {
$pidRow = t3lib_BEfunc::getRecord('pages',abs($positionPid),'pid');
$positionPid = $pidRow['pid'];
}
$row = t3lib_BEfunc::getRecord('pages',$positionPid);
$TSconfig = t3lib_BEfunc::getTCEFORM_TSconfig('pages',$row);
return intval($TSconfig['_STORAGE_PID']);
}
}
?>
------------------------------------------------------------------------ODER------------
<?php
class ux_tx_templavoila_dbnewcontentel extends tx_templavoila_dbnewcontentel {
function wizardArray() {
global $LANG, $TYPO3_DB;
$positionPid = $this->id;
$storageFolderPID = $this->getStorageFolderPid($positionPid);
$tTO = 'tx_templavoila_tmplobj';
$tDS = 'tx_templavoila_datastructure';
$res = $TYPO3_DB->exec_SELECTquery (
"$tTO.*",
"$tTO LEFT JOIN $tDS ON $tTO.datastructure = $tDS.uid",
"$tTO.pid=".intval($storageFolderPID)." AND $tDS.scope=2".t3lib_befunc::deleteClause ($tTO).t3lib_befunc::deleteClause ($tDS) );
$fce_count = 1;
$wizardItems = tx_templavoila_dbnewcontentel::wizardArray();
while ($row = $TYPO3_DB->sql_fetch_assoc($res)) {
$tmpFilename = 'uploads/tx_templavoila/'.$row['previewicon'];
$wizardItems['fce_'.$fce_count]['icon'] = (@is_file(PATH_site.$tmpFilename)) ?('../'.$tmpFilename) : ('../'.t3lib_extMgm
::siteRelPath('templavoila').'res1/default_previewicon.gif');
$wizardItems['fce_'.$fce_count]['description'] = $row['description'] ? htmlspecialchars($row['description'])
: $LANG->getLL ('template_nodescriptionavailable');
$wizardItems['fce_'.$fce_count]['title'] = htmlspecialchars($row['title']);
$wizardItems['fce_'.$fce_count]['params'] = '&defVals[tt_content][CType]=templavoila_pi1&defVals[tt_content]
[tx_templavoila_ds]='.$row['datastructure'].'&defVals[tt_content][tx_templavoila_to]='.$row['uid'];
$fce_count ++;
}
ksort($wizardItems); return $wizardItems;
}
function getStorageFolderPid($positionPid) {
// Negative PID values is pointing to a page on the same level as the current.
if ($positionPid<0) {
$pidRow = t3lib_BEfunc::getRecord('pages',abs($positionPid),'pid');
$positionPid = $pidRow['pid'];
}
$row = t3lib_BEfunc::getRecord('pages',$positionPid);
$TSconfig = t3lib_BEfunc::getTCEFORM_TSconfig('pages',$row);
return intval($TSconfig['_STORAGE_PID']);
}
}
?>