Zum Inhalt springen

GMENU + JS

Erstellt am 3. Juli 2012 · Noch keine Antworten

Tags: Frage

quelquechot ·

Hallo zusammen,

ich bin schon total verzweifelt :o deshalb hoffe ich, dass mir jemand von euch weiterhelfen kann. Ich möchte ein grafisches Hauptmenü mit einer Ebene erstellen. Einer der Menüpunkte muss aber direkt eine JS Funktion aufrufen können (nach Schema "javascript:fc()" ) um eine Lightbox zu öffnen. Die Adresse des Menüpunktes (index.php?id=X) soll außerdem nicht direkt aufrufbar sein (z.B. über Google oder so). Nun habe ich zuerst die "urltypes" um einen zusätzlichen Eintrag beim Seitentyp "externer Link" ergänzt und bei "url" meine Funktion hinterlegt. Soweit so gut.

Nun bekomme ich es aber einfach nicht hin, dass die Funktion direkt aufgerufen wird und der Menüpunkt außerdem genau die gleiche "Formatierung" hat wie die anderen.

Ich würde mich sehr freuen, wenn mir jemand weiterhelfen könnte.
Vielen vielen Dank schon mal!

lib.mnu = HMENU
lib.mnu {

    1 = GMENU
    1 {

        # Normal-Zustand
        NO = 1
        NO {

            wrap = <div class="mnuItem">|</div>
            XY = 237,39

            backColor = #2B2B2B
            transparentColor = #2B2B2B
            transparentBackground = true

            quality = 100
            format = png

            5 = IMAGE
            5.file = fileadmin/system/img/bg_btn_mnu.png

            10 = TEXT
            10 {
                text.field = title
                offset = 15,24
                fontSize = 18
                align = left
                fontColor = #000000
                spacing = 2
                antiAlias = true
                fontFile = fileadmin/system/fnt/Light.ttf
            }
            20 = TEXT
            20 {
                text.field = title
                offset = 15,26
                fontSize = 18
                align = left
                fontColor = #F6F6F6
                spacing = 2
                antiAlias = true
                fontFile = fileadmin/system/fnt/Light.ttf
            }  

#-------------------------------

#      doNotLinkIt = true            
      allStdWrap.override.cObject = CASE
      allStdWrap.override.cObject {
        key.field = doktype
        # externer Link
        3 = COA
        3 {

          10 = TEXT
          10 {
            field = title
            typolink.parameter.data >
            typolink.parameter.dataWrap = javascript:{field:url}
            typolink.ATagBeforeWrap = true
            stdWrap.htmlSpecialChars = true
            if {
              value = 5
              equals.field = urltype
            }
          }
        }
      }

#-------------------------------
          
        }

        # Aktiv-Zustand
        ACT = 1
        ACT < .NO
        ACT {
            backColor = #333333
            transparentColor = #333333

            10.fontColor = #F6F6F6
            10.fontSize = 18
            10.antiAlias = true
            10.spacing = 2
            10.offset = 15,27

            20.fontColor = #000000
            20.fontSize = 18
            20.antiAlias = true
            20.spacing = 2
            20.offset = 15,26

            5.file = fileadmin/system/img/bg_btn_mnu_active.png
        }

        # Mouseover-Zustand
        RO = 1
        RO < .NO
        RO {
           backColor = #2B2B2B
           transparentColor = #2B2B2B

           10.fontColor = #000000
           10.fontSize = 18
           10.offset = 15,24
           10.antiAlias = true
           10.spacing = 2

           20.fontColor = #F29300
           20.fontSize = 18
           20.offset = 15,26
           20.antiAlias = true   
           20.spacing = 2

           5.file = fileadmin/system/img/bg_btn_mnu.png
        }
    }
}