[Typo3] GMENU Individual Button Parameters

Liam Wilks l.wilks at sportingpulse.com.au
Tue May 31 03:11:42 CEST 2005


Hi again,

For anyone that is interested, I managed to achieve this using 
IProcFunc. I create an array of values that list uids where I want the
link to be switched off (set as #) and my IProcFunc function checks each
item and switches the link off if it is in my list. This allows me to
still display the button and submenu, but without the button linking
anywhere.

If you don't know what I mean visit http://www.sharks.com.au and take a
look at the "Leagues Club" button.

Menu typoscript in template:
page.includeLibs.gmenu_layers = media/scripts/gmenu_layers.php
page.includeLibs.IProcFunc = fileadmin/scripts/IProcFunc.php
lib.menu_1 = HMENU
lib.menu_1.special = list
lib.menu_1.special.value = 49,29,16,15,14,13,12,11,10,9
lib.menu_1.linkOff = 29
lib.menu_1 {
  1 = GMENU_LAYERS
  1 {
    xPosOffset = -0
    topOffset = 25
    lockPosition = x
    expAll=1
    relativeToTriggerItem = 1
    wrap = <table><tr>|</tr></table>
    IProcFunc = user_IProcFunc_LinkOff
    NO {
      wrap = <td>|</td>
      altImgResource.import = fileadmin/templates/images/
      altImgResource.import.field = media
      altImgResource.import.listNum = 0
    }
    RO < .NO
    RO = 1
    RO {
      altImgResource.import.listNum = 1
    }
  }
  2 = GMENU
  2 {
    NO {
      wrap = |<BR>
      backColor = #003c63
      XY = 150, 20
      20 = TEXT
      20 {
        text.field = title
        fontColor = #84b6d6
        fontSize = 13
        fontFile = fileadmin/templates/res/impact.ttf
        offset = 5,15
        niceText = 1
      }
    }
    RO < .NO
    RO = 1
    RO.20.fontColor = #ffffff
  }
}



fileadmin/scripts/IProcFunc.php:

<?php
                                                                                                                                                  
function user_IProcFunc_LinkOff($I,$conf) {
                                                                                                                                                     
  // Get linkOff list and convert to array
  $linkOff = split(',', $conf['parentObj']->conf['linkOff']);
                                                                                                                                                     
  // Traverse through array and see if this item is a match
  foreach ($linkOff as $itemID) {
                                                                                                                                                     
    // If item matches set link to #
    if ($I['uid'] == $itemID) {
      $I['linkHREF']['HREF'] = '#';
      $conf['parentObj']->I = $I;
      $conf['parentObj']->setATagParts();
      $I = $conf['parentObj']->I;
      if ($I['parts']['ATag_begin']) 
$I['parts']['ATag_begin']=$I['A1'];
    }
  }
                                                                                                                                                     
    // Returns:
  return $I;
}                                                                                                                                                   
?>

Regards,
Liam Wilks
SportingPulse.Com
-- 

Liam Wilks
SportingPulse Pty Ltd

Email: l.wilks at sportingpulse.com
Website: www.sportingpulse.com

+***************************************************************+
 This email and any files transmitted with it are confidential
 to the intended recipient and may be privileged. This email
 and any attachments are also subject to copyright. If you have
 received this email inadvertently or you are not the intended
 recipient, you may not disseminate, distribute, copy or in
 any way rely on it. Further, you should notify the sender
 immediately and delete the email from your computer. Whilst we
 have taken precautions to alert us to the presence of computer
 viruses, we cannot guarantee that this email and any files
 transmitted with it are free from such viruses.
+**************************************************************+




More information about the TYPO3-english mailing list