Tabsmenu (TMENU) Sample

Submitting your vote...
Rating: 5.0 of 5. 2 vote(s).
Click the rating bar to rate this item.

This snippet creates a tab menu using a TMENU. The following images are used:

TYPO3Wizard.com sample Tabs Menu (TMEN) image left 1TYPO3Wizard.com sample Tabs Menu (TMENU) image right 1TYPO3Wizard.com sample Tabs Menu (TMENU) image center 1TYPO3Wizard.com sample Tabs Menu (TMENU) image center 1TYPO3Wizard.com sample Tabs Menu (TMENU) image left 2TYPO3Wizard.com sample Tabs Menu (TMENU) image right 2TYPO3Wizard.com sample Tabs Menu (TMENU) image center leftTYPO3Wizard.com sample Tabs Menu (TMENU) image center right

 

Constants:

 

lib.tabsmenu {
  imagePath = fileadmin/templates/tabs_images/
  leftImgNO = l1.gif
  rightImgNO = r1.gif
  centerImgNO = c1.gif
  leftImgACT = l2.gif
  rightImgACT = r2.gif
  centerLeftImgACT = c2l.gif
  centerRightImgACT = c2r.gif
}

 

Setup:

 

lib.tabsmenu = COA
lib.tabsmenu {
  wrap = <div id="tabsmenu">|</div>
  10 = HMENU
  10.1 = TMENU
  10.1 {
    NO {
      			# Enabled if this menuitem is LEFT of the active menuitem
      before.cObject = IMAGE
      before.cObject.file = {$lib.tabsmenu.imagePath}{$lib.tabsmenu.leftImgNO} || {$lib.tabsmenu.imagePath}{$lib.tabsmenu.centerImgNO}
      before.cObject.wrap = <div class="img">|</div>
      before.cObject.if.isTrue.data = register:curUid
      before.cObject.if.negate = 1
       
      			# Enabled if this menuitem is RIGHT of the active menuitem
      after.cObject = IMAGE
      after.cObject.file = {$lib.tabsmenu.imagePath}{$lib.tabsmenu.centerImgNO} |*||*| {$lib.tabsmenu.imagePath}{$lib.tabsmenu.rightImgNO}
      after.cObject.wrap = <div class="img">|</div>
      after.cObject.if.isTrue.data = register:curUid
      linkWrap = <div class="item">|</div>
      allWrap = |
    }
    ACT < .NO - ERROR: Line 88: Object copied in this line "ACT < .NO" would leave either the value or properties untouched in TypoScript Version 1. Please check that this is not a problem for you.
    ACT = 1
    ACT {
      before.cObject.file = {$lib.tabsmenu.imagePath}{$lib.tabsmenu.leftImgACT} || {$lib.tabsmenu.imagePath}{$lib.tabsmenu.centerLeftImgACT}
      before.cObject.if >
      after.cObject.file =  {$lib.tabsmenu.imagePath}{$lib.tabsmenu.centerRightImgACT} |*||*| {$lib.tabsmenu.imagePath}{$lib.tabsmenu.rightImgACT}
      after.cObject.if >
      linkWrap = <div class="item2">|</div>
      stdWrap.cObject = COA
      stdWrap.cObject {
        10 = TEXT
        10.field = title
        20 = LOAD_REGISTER
        20.curUid= 1
      }
    }
  }
  	# This part adds the closing image, which will be missing in cases where there's no active menuitem 
  20 = IMAGE
  20.file = {$lib.tabsmenu.imagePath}{$lib.tabsmenu.rightImgNO}
  20.wrap = <div class="img">|</div>
  20.if.isTrue.data = register:curUid
  20.if.negate = 1
}



// --- CSS STYLES start ----------------------
page.CSS_inlineStyle (
	#tabsmenu {background: #9F0030;height:28px;padding:20px 0px 0px 0px;}
	html > #tabsmenu {height:48px;}
	#tabsmenu .img,#tabsmenu .item,#tabsmenu .item2 {float: left;}
	#tabsmenu .item {background:#810027;}
	#tabsmenu .item2 {background:#FFFFFF;}
	#tabsmenu .item A,#tabsmenu .item2 A {padding: 0px 10px;line-height:28px; font-family: Verdana;font-weight:bold;font-size: .8em;text-decoration:none;}
	#tabsmenu .item A {color: #FFFFFF;}
	#tabsmenu .item2 A {color: #000000;}
	#tabsmenu .item A:hover,#tabsmenu2 .item A:hover {text-decoration:underline;}
)
// --- CCS STYLES end ------------------------

 

Click here to see the menu

 

This snippet menu was submitted by Peter Klein


Top 10 Updates

Using lightbox without extension geändert am  13-Jun-2008 14:20:51
Custom field for GMENU alt text geändert am  13-Jun-2008 13:58:07
Extending typoscript properties with stdWrap geändert am  13-Jun-2008 13:54:32
Create menus using data from other tables than "pages" V2  geändert am  24-Mar-2008 13:02:09
Login geändert am  17-Mar-2008 12:47:52
Forum geändert am  17-Mar-2008 10:07:47
Who is Typo3wizard.com geändert am  26-Dec-2007 16:07:32
Menu as un-nested lists (iphone navigation) geändert am  29-Oct-2007 15:05:53
IF Conditions with AND and OR operators geändert am  16-Oct-2007 19:16:04
UserFunc to fix problems with HMENU type "special=updated"  geändert am  16-Oct-2007 18:58:40
Deutsch
Search: