[Typo3] rollover on gifbuilder objects possible? (not gmenu)

Peter Klein peter at umloud.dk
Sun Dec 18 18:38:59 CET 2005

Hi Rafael, here's a codesnippet that allows you to use other tables than 
'pages' to render menus.
What it does is adding a TS "select" property to the userFunc.. More info on 
"select" can be found in TSRef.

Create a file in your "fileadmin" folder, and name it "menuFunc.inc"
then fill the file with this content:
-- cut --
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()) {
  } else {
   while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
    $menuArr[] = $row;
  return $menuArr;
-- cut --

And here's a simple example using the function to create a list of 
tt_address records in a standard TMENU. (Which could also have been a GMENU)

-- cut --
page.includeLibs.usermenu = fileadmin/menuFunc.inc

lib.usermenu = HMENU
lib.usermenu.special = userfunction
lib.usermenu.special.userFunc = user_menuFunc->makeMenuArray
lib.usermenu.special.userFunc.table = tt_addess
lib.usermenu.special.userFunc.select.pidInList = 4
lib.usermenu.1 = TMENU
lib.usermenu.1 {
  NO {
    doNotLinkIt = 1
    stdWrap.field = user
    # Remove the # from the next line if you want to see which fields are 
    #stdWrap.data = debug:data
    typolink.parameter.field = www
    allWrap = <br>
-- cut --

BTW: Remember to change the "select" statement in the line:

  lib.usermenu.special.userFunc.select.pidInList = 4

to point to the sysfolder where your tt_address records are located..

Peter Klein /Umloud Untd.

""Rafael Schär [beYou media]"" <typo3 at beyoumedia.com> wrote in message 
news:mailman.1.1134925691.20717.typo3-english at lists.netfielders.de...
> hi
> thnx a lot peter, i didn't success with that.
> I found in this case another way. I did it with opacity because it is a 
> black/ grey menu. (little fakey) :)
> Anyway thnx a lot
> Rafael
> Peter Klein wrote:
>> Hi Rafael. Gifbuilder has no rollover state, but you could write a small 
>> userfunction for HMENU, to transfer the tt_address records to the 
>> menuarray. Then you can use GMENU to make rollover states..
>> There's an example on how to create 'fake menus' at the bottom of this 
>> page..
>> http://typo3.org/documentation/document-library/doc_core_tsref/HMENU/
>> --- 

More information about the TYPO3-english mailing list