Hallo,
wie kann ich z.B. einen in PHP erzeugten Wert als Wert für das HMENU-Attribut maxItems einsetzen?
PHP ist schon vorhanden:
<?php
class user_navBoxItems
{
function maxNumOfTd1()
{
global $GLOBALS;
$content = $GLOBALS["TSFE"]->sys_page->getMenu($GLOBALS["TSFE"]->id);
$output = sizeof($content);
$output = ceil($output/2);
return $output;
}
function begNumOfTd2()
{
global $GLOBALS;
$content = $GLOBALS["TSFE"]->sys_page->getMenu($GLOBALS["TSFE"]->id);
$output = sizeof($content);
$output = ceil($output/2)+1;
return $output;
}
}
?>
Die Funktionen kann ich von Typo3 auch schon ansprechen (includeLibs im Haupttemplate):
ext.navbox = COA
ext.navbox {
5 = USER
5.userFunc = user_navBoxItems->maxNumOfTd1
}
Wenn ich z.B. in PHP ein echo mache, wird der korrekte Wert damit auch ausgegebn. Wie weise ich aber nun meinem HMENU bzw. maxItems den richtigen Wert zu?
ext.navbox = COA
ext.navbox {
5 = USER
5.userFunc = user_navBoxItems->maxNumOfTd1
20 = HMENU
20.special = directory
20.special.field = uid
20.maxItems = ?
20.1 = TMENU
...
}