[TYPO3] Navigation from other table than pages
christian oettinger
christian.oettinger at gmx.de
Fri Jan 26 16:36:15 CET 2007
Thank you very much, Peter! Works great.
In the meantime, unfortunately the requirements have changed (I
noneoftheless keep it in this thread, for it fits anyway).
I don't know if it is possible -hope you answer me also if you don't see
a way. I try to explain what the customer wants now. In the End I get
the following Navigation:
Point 1
Certificate 1
Certificate 2
Point 2
Point 3
It works just like a normal Navigation. The problem now: the
certificates should be read out of my table, not from the table pages.
That was already solved by Peter. But the (new) higher-ranking Menu
points Point 1, Point 2, Point 3... are Pages that have to appear in the
same Navigation structure. So I have the problem to combine the two
Menus - so that the certificates always are on the right place, just as
we are used from menus.
Below you find the code, that gves out both menus, but uncombined.
If anyone has an idea, please tell me.
If you think it can not be made, please tell me also!
many thanks & greetings from munich
oe (christian)
__________________________________________________________
CODE 1: php user func. (provided by Peter Klein)
<?php
class user_menuFunc {
function makeMenuArray($content,$conf) {
$menuArr = array();
$lConf = $conf["userFunc."];
$res = $this->cObj->exec_getQuery($lConf["table"],$lConf["select."]);
if ($error = $GLOBALS['TYPO3_DB']->sql_error()) {
$GLOBALS['TT']->setTSlogMessage($error,3);
} else {
$GLOBALS['TT']->setTSlogMessage('NUMROWS:
'.$GLOBALS['TYPO3_DB']->sql_num_rows($res));
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$menuArr[] = $row;
}
}
return $menuArr;
}
}
?>
__________________________________________________________
CODE 2: my actual extension template setup (based on the example of
Peter Klein)
page.includeLibs.usermenu = fileadmin/scripts/menuFunc.inc
lib.usermenu = HMENU
lib.usermenu.special = userfunction
lib.usermenu.special.userFunc = user_menuFunc->makeMenuArray
lib.usermenu.special.userFunc.table = tx_oecertificates_certificates
lib.usermenu.special.userFunc.select.pidInList = {$certificatesfolder}
lib.usermenu.1 = TMENU
lib.usermenu.1 {
NO {
#doNotLinkIt = 1
stdWrap.data = field:name
stdWrap.typolink.parameter.data = TSFE:id
stdWrap.typolink.additionalParams.field= uid
stdWrap.typolink.additionalParams.wrap=
&tx_oecertificates_pi1[showUid]=|
#stdWrap.data = debug:data
allWrap = <SPAN class="dritteebene"> |</SPAN><BR>
}
}
page.999 < lib.usermenu
__________________________________________________________
CODE 3: my Menu in Setup:
page.15 = HMENU
page.15.stdWrap.wrap = <div id="menu2">|</div>
page.15.entryLevel = 1
page.15.1 = TMENU
page.15.1.target = _top
page.15.1 {
fontColor = #ffffff
expAll = 1
NO.linkWrap = <SPAN class="zweiteebene"> |</SPAN><BR>
NO.ATagBeforeWrap = 1
ACT < .NO
ACT = 1
ACT.linkWrap = <SPAN class="womanist2"> | </SPAN><BR>
ACT.ATagBeforeWrap = 1
SPC = 1
SPC.allWrap=|{$smallcleargif}<br>
SPC.doNotLinkIt = 1
SPC.doNotShowLink = 1
}
page.15.2 {
fontColor = #ffffff
expAll = 1
NO.linkWrap = <SPAN class="dritteebene"> |</SPAN><BR>
NO.ATagBeforeWrap = 1
ACT < .NO
ACT = 1
ACT.linkWrap = <SPAN class="womanist3"> | </SPAN><BR>
ACT.ATagBeforeWrap = 1
SPC = 1
SPC.allWrap=|{$smallcleargif}<br>
SPC.doNotLinkIt = 1
SPC.doNotShowLink = 1
}
More information about the TYPO3-english
mailing list