[TYPO3-english] TS to change plugin configuration according to position on page (tt_news)
Steffen Kamper
info at sk-typo3.de
Tue Nov 24 13:26:41 CET 2009
Hi Xavier,
Xavier Perseguers schrieb:
> Hi,
>
> I use TV for a website and would like to have a different TS
> configuration according to where a tt_news plugin is put on page (either
> in TV placeholder "content" or in TV placeholder "sidebar").
>
> Any idea?
>
> Something that would work would be to define to TS object holding a
> special tt_news configuration (e.g. for sidebar) and ask editors to use
> EXT:tscobj but perhaps there's a better (=easier for editors) approach
> using some TS condition?
>
unfortunally there is no such possibility for now.
I've done simular user_functions which can be used in TS condition, it's
not such hard :)
Here is the main operation needed:
// Get DS of page record
$pageRecord = $GLOBALS['TSFE']->page;
if (!$conf['columns'] || !isset($pageRecord['tx_templavoila_flex']) ||
$pageRecord['tx_templavoila_flex'] == '') {
return;
}
$columns = t3lib_div::trimExplode(',', $conf['columns'], TRUE);
$pageArray = t3lib_div::xml2array($pageRecord['tx_templavoila_flex']);
// GET used CEs
$contentIdList = '';
foreach ($columns as $column) {
if (isset($pageArray['data']['sDEF']['lDEF'][$column])) {
$contentIdList .= $pageArray['data']['sDEF']['lDEF'][$column]['vDEF']
. ',';
}
}
$contentIdList = substr($contentIdList, 0, -1);
if ($contentIdList === '') {
return;
}
// Get all used CE's
$records =
$GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,tx_templavoila_ds,list_type',
'tt_content', 'uid in(' . $contentIdList . ')');
foreach ($records as $record) {
// do your stuff or return value for userfunc
}
vg Steffen
More information about the TYPO3-english
mailing list