Flexible Contents & Templavoila: Display in Content Element Wizard

 / Main / Articles / Flexible Content & Templavoila: Display in Content Element Wizard

Question: Why are my Flexible Content Elements not  shown in the Content Element Wizard?

Answer: Because this isn't  implemented yet in the current version of TemplaVoila ( 0.4). I use an XClass to show them  in the Content Element Wizard.

 

Save the following PHP script for example as

typo3conf/ext/templavoila/mod1/my_content_wizard.php

 

Add the new class to 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']);

}

}

?>

Have Fun

 

tobi

 



Comments


Peter, 18-11-05 16:08:
The same can be accomplished by installing the extension "TV Flexible Content Wizard" (Ext key: templavoila_cw)
Sewana, 03-07-11 19:17:
Cheers pal. I do appreciate the wtriing.

Add comment

* - required field

*



*
*

Top 10 Updates

Nice fonts using Google font API geändert am  20-May-2010 16:36:47
TS-based Searchbox for Indexed Search  geändert am  18-May-2010 18:27:15
TYPO3 SEO geändert am  30-Apr-2010 09:44:22
Search engine friendly graphical headers in TYPO3 geändert am  30-Apr-2010 09:33:44
Creating a simple Infocenter using TYPO3 geändert am  17-Nov-2009 12:12:52
Making the Section Menu work correctly with TemplaVoila geändert am  05-May-2009 12:27:17
Show pages with type "Not in Menu" in a sitemap geändert am  05-May-2009 12:11:17
Implementation of the DHTML menu from brainjar.com  geändert am  01-Feb-2009 14:02:48
Sample DHTML menu geändert am  01-Feb-2009 13:51:25
A introduction to the CONTENT object geändert am  26-Jan-2009 13:20:39

Latest comments

21-Jan-2012 20:22:24
jemmkwc jemmkwc schrieb: MOGWOX , [url=http://prdpuhwzxyrc.com/]prdpuhwzxyrc[/url],...
fe_useradmin form does not save
20-Jan-2012 20:35:32
fsivjktiuld fsivjktiuld schrieb: idCmnv <a href="http://gakbrrkrxhye.com/">gakbrrkrxhye</a>
fe_useradmin form does not save
19-Jan-2012 18:05:25
bvffee bvffee schrieb: jl2vQt , [url=http://xcinvpbclrbm.com/]xcinvpbclrbm[/url],...
External links and shortcuts directly in the menu
Deutsch
Search: