TYPO3 Typoscript Menü Snippets Überblick
l-base Hauptmenü
Das Layermenü funktioniert nicht im IE 6 oder kleiner.
### Typoscript ###
page.includeLibs.changecolor = fileadmin/scripts/changecolor.php
# Generate navigation:
lib.lbase = HMENU
lib.lbase{
excludeUidList = 100
1 = GMENU
1{
wrap = <div class="menu_lbase"><ul>|</ul></div>
expAll=1
NO {
XY = 204,61
transparentBackground = 1
backColor = black
allWrap = <li>|</li>
5 = IMAGE
5.file = fileadmin/layout_images/btn_mainmenu_no.gif
10 = TEXT
10.text.field = nav_title // title
10.fontColor = #999999
10.fontFile = fileadmin/templates/fonts/Share-Regular.ttf
10.niceText = 1
10.fontSize = 22
10.offset = 10,40
}
IFSUB < .NO
IFSUB = 1
IFSUB{
allWrap = <li class="sub_lbase">|
}
IFSUBRO < .NO
IFSUBRO = 1
IFSUBRO{
transparentBackground = 0
5.file = fileadmin/layout_images/btn_mainmenu_ho_brown.gif |*| fileadmin/layout_images/btn_mainmenu_ho_red.gif |*| fileadmin/layout_images/btn_mainmenu_ho_greyblue.gif
10.fontColor = #333333
allWrap = <li class="sub_lbase">|
}
RO < .NO
RO = 1
RO {
transparentBackground = 0
5.file = fileadmin/layout_images/btn_mainmenu_ho_brown.gif |*| fileadmin/layout_images/btn_mainmenu_ho_red.gif |*| fileadmin/layout_images/btn_mainmenu_ho_greyblue.gif
10.fontColor = #333333
}
ACT < .RO
ACT = 1
ACT{
allWrap = <li class="sub_lbase">|
}
}
2 = TMENU
2{
IProcFunc = user_submenu2->changeColor
wrap = <ul>|</ul></li>
expAll=1
NO{
allWrap = <li>|</li>
}
}
}
/* ================================================================
This copyright notice must be untouched at all times.
The original version of this stylesheet and the associated (x)html
is available at http://www.cssplay.co.uk/menus/flyout_4level.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This stylesheet and the associated (x)html may be modified in any
way to fit your requirements.
=================================================================== */
.menu_lbase {
height:1%;
font-size:90%;
margin:0px; /* this page only */
}
/* remove all the bullets, borders and padding from the default list styling */
.menu_lbase ul {
position:relative;
z-index:500;
padding:0;
margin:0;
list-style-type:none;
width:204px;
}
/* style the list items */
.menu_lbase li {
height:61px;
background:none;
/* for IE7 */
float:left;
}
.menu_lbase li li{
height:24px;
/*background:#c3e922 url(shade.gif);*/
}
.menu_lbase li li.oben{background-color:#705e50;}
.menu_lbase li li.mitte{background-color:#c71315;}
.menu_lbase li li.unten{background-color:#cbd7d4;}
.menu_lbase li.sub_lbase {background:none;}
.menu_lbase ul ul{background:#d4d8bd url(shade.gif);}
/* get rid of the table */
.menu_lbase table {position:absolute; border-collapse:collapse; top:0; left:0; z-index:100; font-size:1em;}
/* style the links */
.menu_lbase a, .menu_lbase a:visited {
display:block;
text-decoration:none;
height:24px;
line-height:24px;
width:204px;
color:#000;
/*text-indent:5px;*/
border:0px solid #fff;
}
/* style the links */
.menu_lbase li li a, .menu_lbase li li a:visited {
display:block;
text-decoration:none;
height:24px;
line-height:24px;
width:204px;
color:#fff;
text-indent:5px;
border:1px solid #ccc;
border-width:2px 0px 0px 0px;
}
/* hack for IE5.5 */
* html .menu_lbase a, * html .menu_lbase a:visited {width:150px; w\idth:149px;}
/* style the link hover */
* html .menu_lbase a:hover {color:#efa; background:#aa7; position:relative;}
.menu_lbase li:hover {position:relative;}
/* For accessibility of the top level menu when tabbing */
.menu_lbase a:active, .menu_lbase a:focus {color:#efa; background:#aa7;}
/* retain the hover colors for each sublevel IE7 and Firefox etc */
.menu_lbase li:hover > a {color:#efa; background:none;}
.menu_lbase li li:hover > a {color:#333; background-color:#efefef;}
/* hide the sub levels and give them a positon absolute so that they take up no room */
.menu_lbase li ul {
visibility:hidden;
position:absolute;
/*position:relative;*/
top:-30px;
/* set up the overlap (minus the overrun) */
left:174px;
/* set up the overrun area */
padding:30px;
/* this is for IE to make it interpret the overrrun padding */
background:transparent url(transparent.gif);
}
/* for browsers that understand this is all you need for the flyouts */
.menu_lbase li:hover > ul {visibility:visible;}
/* for IE5.5 and IE6 you need to style each level hover */
/* keep the third level+ hidden when you hover on first level link */
.menu_lbase ul a:hover ul ul{
visibility:hidden;
}
/* keep the fourth level+ hidden when you hover on second level link */
.menu_lbase ul a:hover ul a:hover ul ul{
visibility:hidden;
}
/* keep the fifth level hidden when you hover on third level link */
.menu_lbase ul a:hover ul a:hover ul a:hover ul ul{
visibility:hidden;
}
/* make the second level visible when hover on first level link */
.menu_lbase ul a:hover ul {
visibility:visible;
}
/* make the third level visible when you hover over second level link */
.menu_lbase ul a:hover ul a:hover ul{
visibility:visible;
}
/* make the fourth level visible when you hover over third level link */
.menu_lbase ul a:hover ul a:hover ul a:hover ul {
visibility:visible;
}
/* make the fifth level visible when you hover over fourth level link */
.menu_lbase ul a:hover ul a:hover ul a:hover ul a:hover ul {
visibility:visible;
}<?php
class user_submenu2 {
function changecolor($I,$conf) {
if ($I['pid'] == 2 ) {
$I['val']['allWrap']= '<li class="unten" >|</li>';
}
if ($I['pid'] == 3 ) {
$I['val']['allWrap']= '<li class="mitte" >|</li>';
}
if ($I['pid'] == 97 ) {
$I['val']['allWrap']= '<li class="oben" >|</li>';
}
// Returns:
return $I;
}
}
?>







