Zum Inhalt springen

Horizontales GMENU Level1 und Level2

Erstellt am 27. Oktober 2006 · 4 Antworten · letzte Antwort am 31. Oktober 2006

Tags: Frage

mht2006 ·

Hallo zusammen,

ich arbeite mich seit kurzem in Typo3 ein und bis jetzt hat auch alles super geklappt.
Nun bin ich aber auf folgendes Problem gestoßen und ich hoffe, dass mir vielleicht jemand dabei behilflich sein kann.

Die Typo3 Seite soll ein horizontales Menü besitzen [das hab ich auch noch hinbekommen] und bei Bedarf soll sich das Submenü darunter befinden. Momentan befindet sich das Submenü aber immer direkt hinter dem angeklickten Menüpunkt; Bsp. Meüpunkt_1->Meüpunkt_1.1->Meüpunkt_1.2->Meüpunkt_2->Meüpunkt_3 usw.

Wie bekomme ich es hin, dass das Submenü nicht angehängt wird, sonder eine Zeile unter dem Hauptmenü? Das Hauptmenü habe ich mit dem Marker ###HAUPTMENU### gekenntzeichnet. Darunter liegt mit einem <br> der Marker ###SUBMENU###. Kann mir da vielleicht jemand weiterhelfen. Danke schon mal im vorraus.

Hier noch das passende TS Script:

  # Das grafische Menü erstellen
  HAUPTMENU = HMENU
  HAUPTMENU {
   special = directory
   special.value = 54
   entryLevel = 1
   1 = GMENU
   1.NO = 1
   1.NO {
    XY = [10.w]+50,25
    backColor = #999999
    transparentColor = #999999
    transparentBackground = 0,0
			
    # Text auf den Menüpunkt rendern
    10 = TEXT
    10 {
     text.field = title
     text.listNum = 0
     fontColor = #333333
     fontFile = fileadmin/fonts/FrnkGothITC_Bk_BT_Book.TTF
     fontSize = 13
     niceText = 0
     antiAlias = 1
     offset = 10, 17
    }
   }
		 
   # Einen RollOver-Zustand beschreiben
   1.RO < .1.NO
   1.RO { 
    backColor = #999999
    transparentColor = #999999
    transparentBackground = 0,0
    
    10 = TEXT
    10 {
     text.field = title
     text.listNum = 0
     fontColor = #005AA9
     fontFile = fileadmin/fonts/FrnkGothITC_Bk_BT_Book.TTF
     fontSize = 13
     niceText = 0
     antiAlias = 1
     offset = 10, 17
    }
   }
   
   # Die zweite Ebene als Kopie der ersten Ebene beschreiben
   2 < .1
   2.NO {
    backColor = #D3E2F9
    10 { 
     fontColor = #061467
     fontSize = 11
    }
   }
   2.RO < .2.NO
   2.RO.backColor = #C1D5F4 
  }
n2o ·

Hi,

am besten machst das Hauptmenü mit

entryLevel = 1

und

expAll = 0

(expAll = 0 bewirkt das, dass Untermenü nicht angezeigt wird)
dazu noch dein Submenü mit

entryLevel = 2

wenn du solche Probleme hast hilft dir oft die TypoScript Referenz die findest du hier:

TypoScript Referenz

gruss n2o

mht2006 ·

hab´s nun endlich hinbekommen, dass das submenü erstellt wird. im setup steht nun folgendes:

[...]
10.marks {  
 HAUPTMENU < tmp.HAUPTMENU
 SUBMENU < tmp.SUBMENU
 }
[...]

Das HAUPTMENU Template sieht folgendermaßen aus:

# Das grafische Menü erstellen
tmp.HAUPTMENU = HMENU
tmp.HAUPTMENU {
 special = directory
 special.value = 54
 entryLevel = 1
 expAll = 0 
 1 = GMENU
 1.NO = 1
 1.NO {
  #wrap = |<br>
  XY = [10.w]+50,25
  backColor = #999999
  transparentColor = #999999
  transparentBackground = 0,0
  	
  # Text auf den Menüpunkt rendern
  10 = TEXT
  10 {
   text.field = title
   text.listNum = 0
   fontColor = #333333
   fontFile = fileadmin/fonts/FrnkGothITC_Bk_BT_Book.TTF
   fontSize = 13
   niceText = 0
   antiAlias = 1
   offset = 10, 17
  }
 }
 
 # Einen RollOver-Zustand beschreiben
 1.RO < .1.NO
 1.RO { 
  backColor = #999999
  transparentColor = #999999
  transparentBackground = 0,0
    
  10 = TEXT
  10 {
   text.field = title
   text.listNum = 0
   fontColor = #005AA9
   fontFile = fileadmin/fonts/FrnkGothITC_Bk_BT_Book.TTF
   fontSize = 13
   niceText = 0
   antiAlias = 1
   offset = 10, 17
  }
 }
 
 1.ACT < .1.NO
 1.ACT {
  backColor = #999999
  transparentColor = #999999
  transparentBackground = 0,0
  
  10 = TEXT
  10 {
   text.field = title
   text.listNum = 0
   fontColor = #005BA9
   fontFile = fileadmin/fonts/FrnkGothITC_Bk_BT_Book.TTF
   fontSize = 13
   niceText = 0
   antiAlias = 1
   offset = 10, 17
  }
 }
}

und das SUBMENU Template sieht so aus:

# Das grafische Menü erstellen
tmp.SUBMENU < tmp.HAUPTMENU.1
tmp.SUBMENU = HMENU
tmp.SUBMENU {
 special = directory
 entryLevel = 2
 1 = GMENU
 1.NO = 1
 1.NO {
  XY = [10.w]+50,25
  backColor = #BCE7ED
  transparentColor = #BCE7ED
  transparentBackground = 0,0
  	
  # Text auf den Menüpunkt rendern
  10 = TEXT
  10 {
   text.field = title
   text.listNum = 0
   fontColor = #333333
   fontFile = fileadmin/fonts/FrnkGothITC_Bk_BT_Book.TTF
   fontSize = 12
   niceText = 0
   antiAlias = 1
   offset = 10, 17
  }
 }
 
 # Einen RollOver-Zustand beschreiben
 1.RO < .1.NO
 1.RO { 
  backColor = #BCE7ED
  transparentColor = #BCE7ED
  transparentBackground = 0,0
    
  10 = TEXT
  10 {
   text.field = title
   text.listNum = 0
   fontColor = #005AA9
   fontFile = fileadmin/fonts/FrnkGothITC_Bk_BT_Book.TTF
   fontSize = 12
   niceText = 0
   antiAlias = 1
   offset = 10, 17
  }
 }
}

Mein einziges Problem ist jetzt leider noch, dass beim anklicken eines Submenü Punktes das Hauptmenü verschwindet. Kennt da jemand den Grund bzw. eine Lösung?

mht2006 ·

habe alle fehler endteckt [das hoffe ich mal] und das funktionierende script sieht nun wie folgt aus:

TS Setup:

[...]
 10.marks {
  HAUPTMENU < tmp.HAUPTMENU
  SUBMENU < tmp.SUBMENU
 }
[...]

Das HAUPTMENU Template sieht folgendermaßen aus:

# Das grafische Menü erstellen
tmp.HAUPTMENU = HMENU
tmp.HAUPTMENU {
 special = directory
 special.value = 54
 entryLevel = 1
 expAll = 0 
 1 = GMENU
 1.NO = 1
 1.NO {
  XY = [10.w]+50,25
  backColor = #999999
  transparentColor = #999999
  transparentBackground = 0,0
  5 = IMAGE
  5 {
   file = uploads/tf/hauptmenue_aufzaehlung.gif
   offset = 10, 0
  }
  	
  # Text auf den Menüpunkt rendern
  10 = TEXT
  10 {
   text.field = title
   text.listNum = 0
   fontColor = #333333
   fontFile = fileadmin/fonts/FrnkGothITC_Bk_BT_Book.TTF
   fontSize = 13
   niceText = 0
   antiAlias = 1
   offset = 20, 17
  }
 }
 
 # Einen RollOver-Zustand beschreiben
 1.RO < .1.NO
 1.RO {
  backColor = #999999
  transparentColor = #999999
  transparentBackground = 0,0  
  5 = IMAGE
  5 {
   file = uploads/tf/hauptmenue_aufzaehlung_acti.gif
  }
    
  10 = TEXT
  10 {
   text.field = title
   text.listNum = 0
   fontColor = #005AA9
   fontFile = fileadmin/fonts/FrnkGothITC_Bk_BT_Book.TTF
   fontSize = 13
   niceText = 0
   antiAlias = 1
   offset = 20, 17
  }
 }
 
 1.ACT < .1.NO
 1.ACT {
  backColor = #999999
  transparentColor = #999999
  transparentBackground = 0,0
  5 = IMAGE
  5 {
   file = uploads/tf/hauptmenue_aufzaehlung_acti.gif
  }
  
  10 = TEXT
  10 {
   text.field = title
   text.listNum = 0
   fontColor = #005BA9
   fontFile = fileadmin/fonts/FrnkGothITC_Bk_BT_Book.TTF
   fontSize = 13
   niceText = 0
   antiAlias = 1
   offset = 20, 17
  }
 }
}

und das SUBMENU Template sieht so aus:

# Das grafische Menü erstellen
tmp.SUBMENU < tmp.HAUPTMENU.1
tmp.SUBMENU = HMENU
tmp.SUBMENU {
 entryLevel = 2
 1 = GMENU
 1.NO = 1
 1.NO {
  XY = [10.w]+50,25
  backColor = #BCE7ED
  transparentColor = #BCE7ED
  transparentBackground = 0,0  
  5 = IMAGE
  5 {
   file = uploads/tf/submenue_aufzaehlung.gif
   offset = 10, 0
  }
  	
  # Text auf den Menüpunkt rendern
  10 = TEXT
  10 {
   text.field = title
   text.listNum = 0
   fontColor = #333333
   fontFile = fileadmin/fonts/FrnkGothITC_Bk_BT_Book.TTF
   fontSize = 12
   niceText = 0
   antiAlias = 1
   offset = 20, 17
  }
 }
 
 # Einen RollOver-Zustand beschreiben
 1.RO < .1.NO
 1.RO { 
  backColor = #BCE7ED
  transparentColor = #BCE7ED
  transparentBackground = 0,0
  5 = IMAGE
  5 {
   file = uploads/tf/submenue_aufzaehlung_acti.gif
  }  
    
  10 = TEXT
  10 {
   text.field = title
   text.listNum = 0
   fontColor = #005AA9
   fontFile = fileadmin/fonts/FrnkGothITC_Bk_BT_Book.TTF
   fontSize = 12
   niceText = 0
   antiAlias = 1
   offset = 20, 17
  }
 }
 
 1.ACT < .1.NO
 1.ACT {
  backColor = #BCE7ED
  transparentColor = #BCE7ED
  transparentBackground = 0,0
  5 = IMAGE
  5 {
   file = uploads/tf/submenue_aufzaehlung_acti.gif
  }  
  
  10 = TEXT
  10 {
   text.field = title
   text.listNum = 0
   fontColor = #005BA9
   fontFile = fileadmin/fonts/FrnkGothITC_Bk_BT_Book.TTF
   fontSize = 12
   niceText = 0
   antiAlias = 1
   offset = 20, 17
  }
 } 
}

Vielleicht kann der eine oder andere ja etwas damit anfangen. viel spass dabei #giggle#