---
title: "in TS erstelltes, horizontales Drop Down Menu klappt nicht auf, Typo3 generierter Code schliesst den <li>-Tag meines Erachtens zu frueh"
url: "https://www.typo3.net/d/119835-in-ts-erstelltes-horizontales-drop-down-menu-klappt-nicht-auf-typo3-generierter-code-schliesst-den-li-tag-meines-erachtens-zu-frueh"
source: "typo3.net"
tags: ["TYPO3","Menüs","Frage","TYPO3 6"]
created: "2015-03-06"
last_reply: "2015-03-06"
replies: 2
solved: false
page: 1
pages: 1
lang: "de"
---

# in TS erstelltes, horizontales Drop Down Menu klappt nicht auf, Typo3 generierter Code schliesst den <li>-Tag meines Erachtens zu frueh

TYPO3 › Menüs · 2 Antworten · gestartet 2015-03-06

## Eröffnungsbeitrag

**Seahorse** · 2015-03-06 · [Beitrag #1](https://www.typo3.net/d/119835-in-ts-erstelltes-horizontales-drop-down-menu-klappt-nicht-auf-typo3-generierter-code-schliesst-den-li-tag-meines-erachtens-zu-frueh/1)

Hallo,
Habe hier ein reduziertes HTML und CSS, mit denen ein horizontales Menu mit DropDown Function realisiert wird. Im Browser wird dies auch funktionsfaehig dargestellt:
HTML:

```html
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="stylesheet" type="text/css" href="style/testCssNavigation.css" media="screen" />
    </head>

    <body>
        <div>
            <ul class="topNav">
                <li><a href="" class="tmp">Company</a>

                    <ul>
                        <li><a href="">Facts</a></li>
                        <li><a href="">Overview</a></li>
                        <li><a href="">Management</a></li>
                    </ul>
                </li>
                <li><a href="" class="tmp">Products</a>

                    <ul>
                        <li><a href="">Product Line</a>
                            <ul>
                                <li><a href="">Product1</a></li>
                                <li><a href="">Product2</a></li>
                                <li><a href="">Product3</a></li>
                            </ul>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </body>
</html>
```

CSS:

```css
html {
    height: 100%;
}

body {
    height: 100%;
    font-size: 1.5em;
    line-height: 1.5;
    font-family: Arial, Verdana, Helvetica, sans-serif;
}


a, a:link, a:active, a:visited {
    color: #e23427;
    text-decoration: none;
}

li {
    list-style: none;
}

/**1. Ebene Hauptnavigation**/
ul.topNav {
    float: left;
    width: 700px;
    margin: 100px 0 0 40px;

}
ul.topNav li {
    float: left;
    position: relative;
}
ul.topNav li a.tmp {
    color: inherit;
    float: left;
    height: 20px;
    padding: 0 10px;
}
ul.topNav li a:hover.tmp,
ul.topNav li.active a.tmp,
ul.topNav li:hover a.tmp {
    border-bottom: 2px solid #e23427;
    padding-bottom:10px;
    color: #e23427;
}

/**2. Ebene Hauptnavigation**/
ul.topNav li ul {
    display: none;
    position: absolute;
    width: 190px;
    top: 32px;
    left: -2px;
    padding: 5px 2px 2px 2px;
}
ul.topNav li:hover ul {
    display: block;
}
ul.topNav li ul li {
    float: none;
    display: block;
    width: 190px;
    height: auto;
    vertical-align: middle;
}
ul.topNav li ul li a {
    display: block;
    color: #231f20;
    width: 146px;
    padding: 6px 22px;
}
ul.topNav li ul li a:hover,
ul.topNav li ul li a.active {
    color: red;
}

/***3. Ebene Hauptnavigation***/
ul.topNav li:hover ul li ul {
    display: none;
    position: absolute;
    width: 190px;
    left: 188px;
    padding: 0 2px 2px 2px;
    margin-top: -32px;
}
ul.topNav li.eb3Left:hover ul li ul {
    left: -192px;
}
ul.topNav li a:hover ul li ul {
    display: none;
}
ul.topNav li ul li ul {
    display: none;
}
ul.topNav li ul li:hover ul {
    display: block;
}
```

Mein Problem:
Ich sollte das ganze in Typo3 portieren bzw. habe dort das TypoScript wie folgt verfasst:
(nur der Abschnitt fuers Menu...der Rest funktioniert ja)

```actionscript
## Menu [Begin]
lib.mainnav = HMENU
lib.mainnav {
   entryLevel = 1
  
  1 = TMENU
  1 {
    wrap = <ul class="topNav">|</ul>
    expAll = 1
    noBlur = 1
    
##Menuelements normal
    NO = 1
    NO.allWrap = <li>|</li>
    NO.ATagParams = class="tmp"
    NO.stdWrap.htmlSpecialChars = 1
    
    CUR = 1
    CUR.allWrap = <li>|</li>
    CUR.ATagParams = class="tmp"
    CUR.stdWrap.htmlSpecialChars = 1    
  }
  
  2 = TMENU
  2 {
    wrap = <ul>|</ul>
    expAll = 1
    noBlur = 1
  
    NO = 1
    NO.wrapItemAndSub = <li>|</li>
    NO.stdWrap.htmlSpecialChars = 1
    
    CUR = 1
    CUR.wrapItemAndSub = <li>|</li>
    CUR.stdWrap.htmlSpecialChars = 1
    
    ACT = 1
    ACT < .CUR
  }
  ## referenz auf ebene 2, alles wie ebene 2
  3 < .2
  3.wrap = <ul>|</ul>
}
## Menu [End]
```

In der Browseransicht sind nun via Typo3 die Hauptnavigationsueberschriften dort wo sie hingehoeren, jedoch sind die Unterpunkte nicht drunter, sondern daneben. Folgender Code wird generiert:

```html
<div>
	<ul class="topNav">
		<li>
			<a href="index.php?id=112" class="tmp">Company</a>
		</li>
		<ul>
			<li>
				<a href="index.php?id=119">Facts</a>
			</li>
			<li>
				<a href="index.php?id=120">Overview</a>
			</li>
			<li>
				<a href="index.php?id=121">Management</a>
			</li>
		</ul>

		<li>
			<a href="index.php?id=114" class="tmp">Products</a>
		</li>
		<ul>
			<li>
				<a href="index.php?id=126">Product Line</a>
			</li>
		</ul>
	</ul>
</div>
```

Es fehlt hier erstens die 2. Unterebene unter 'Product Line' = Product1, Product2, Product3.

TypoScript schliesst ausserdem den <li>-Tag der obersten Ebene 'Company' sofort wieder, was nehme an der Grund dafuer ist, dass die **Unterpunkte nicht mehr darunter aufgefuehrt werden, sondern daneben**.
Wie bekomme ich das in den Griff bzw. was habe ich falsch gemacht?? Bitte um Hilfe, bin kurz vor Verzweiflung, arbeite schon echt lange an dem Problem!!

P.S. bin noch nicht lange in Foren unterwegs, fuer den Fall, dass ich etwas falsch gemacht habe, bitte ich um Vergebung!

## Antworten

### [#2](https://www.typo3.net/d/119835-in-ts-erstelltes-horizontales-drop-down-menu-klappt-nicht-auf-typo3-generierter-code-schliesst-den-li-tag-meines-erachtens-zu-frueh/2) · jenses · 2015-03-06

wrapItemAndSub gehört auch in die erste Menüebene statt allWrap,
klar daß das so nicht funktioniert...

### [#3](https://www.typo3.net/d/119835-in-ts-erstelltes-horizontales-drop-down-menu-klappt-nicht-auf-typo3-generierter-code-schliesst-den-li-tag-meines-erachtens-zu-frueh/3) · Seahorse · 2015-03-06

Vielen Dank!!!
Hat mich auf den richtigen Pfad gebracht, so funktionierts nun:
:)
## Menu [Begin]
lib.mainnav = HMENU
lib.mainnav {
## Damit es nicht bei Home anfaengt
  entryLevel = 1

1 = TMENU
  1 {
    wrap = <ul class="topNav">|</ul>
    expAll = 1
    noBlur = 1
    NO.wrapItemAndSub = <li>|</li>
    NO.ATagParams = class="tmp"
  }

2 = TMENU
  2 {
    wrap = <ul>|</ul>
    expAll = 1
    noBlur = 1
    NO.wrapItemAndSub = <li>|</li>
  }

3 = TMENU
  3 {
    wrap = <ul>|</ul>
    expAll = 1
    noBlur = 1
    NO.wrapItemAndSub = <li>|</li>
  }
}
## Menu [End]

---

Quelle: „in TS erstelltes, horizontales Drop Down Menu klappt nicht auf, Typo3 generierter Code schliesst den <li>-Tag meines Erachtens zu frueh“, typo3.net, https://www.typo3.net/d/119835-in-ts-erstelltes-horizontales-drop-down-menu-klappt-nicht-auf-typo3-generierter-code-schliesst-den-li-tag-meines-erachtens-zu-frueh
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
