Subscribe to Acqal

Got Thoughts? Write Us!

Contact
Request
Validate

Approved TYPO3 Agency

Acqal is an approved TYPO3 agency focusing on support, training and website migration.

This means that we...

  • are available on TYPO3.org
  • make substantial contributions to TYPO3 teams
  • are registered as business members of the TYPO3 Association
  • have completed more than four TYPO3 projects
  • have proven our technical abilities with quality TYPO3 extensions
  • use TYPO3 for our own website

Acqal is a TYPO3 Association Business Member

Popular Blog Posts

Blog Topics

Virgil on Twitter

Please wait while virgilhuston tweets load Twitter is loading

Recent Blog Posts

Blog Archives

Create a Menu Section Header with TypoScript

Submenu and Header Level 1

Submenu and Header Level 1

Submenu and Header Level 2

Submenu and Header Level 2

Submenu and Header Level 3

Submenu and Header Level 3

Breadcrumb sample

Breadcrumb sample
Tuesday, October 6, 2009 12:01 AM EDT

By: Michael Cannon

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

In the name of usability, it's extremely helpful to keep website users informed of where they are on a website. Frequently, this "where am I" functionality is handled by a breadcrumb, but you can also use section headers to provide similar capability.

The TypoScript that follows, put into your TypoScript template Setup section, performs two functions. The first, lib.nav.sub.header, is to create the section header. The second, lib.nav.sub, incorporates lib.nav.sub.header into the submenu for the section in which a user is located.

When you're ready to insert the submenu, use lib.nav.sub in your TemplaVoila Data Structure XML or TypoScript Setup.

lib.nav.sub.header = HMENU
lib.nav.sub.header {
special = rootline
special.range = 1|1
wrap = <li id="title">|</li>
1 = TMENU
1 {
NO {
doNotLinkIt = 0
ATagTitle.field = description // title
stdWrap.htmlSpecialChars = 1
}
}
}

lib.nav.sub = COA
lib.nav.sub {
wrap = <div id="submenu"><ul>|</ul></div>

10 < lib.nav.sub.header

20 = HMENU
20 {
entryLevel = 1
1 = TMENU
1 {
NO {
wrapItemAndSub = <li>|</li>
ATagTitle.field = description // title
stdWrap.htmlSpecialChars = 1
}

CUR < .NO
CUR = 1
CUR {
wrapItemAndSub = <li id="active">|</li>
doNotLinkIt = 1
}
}

2 < .1
2.wrap = <ul>|</ul>
3 < .2
4 < .2
}
}


Reference

 

Keywords:

  • menu,section header,typoscript,typo3,hmenu


Acqal Corporation is an approved TYPO3 agency with over 40 years of Internet experience. Acqal offers you TYPO3 support, TYPO3 templates and TYPO3 training and tutorials.

Please subscribe to Acqal Newsletter and Acqal Blogging via or RSS Feed Acqal RSS Feed.

© 2009 Acqal Corporation. All Rights Reserved.

Please Share This Post

Tweet thisRedditBookmark on deliciousStumble thisShare on Facebook

Send this article via email to your friends and peers.

Leave a Comment

Add comment

* - required field







Notify me when a new comment is added.
By Jacco Van der Post on Friday, May 28, 2010 8:52 AM EDT
Gravatar: Jacco Van der Post Thx

special = rootline
special.range = 1|1

is what I was looking for :)

gRTz Jacco
By Jacco Van der+Post on Friday, May 28, 2010 9:19 AM EDT
Gravatar: Jacco Van der+Post Your example produces


    <li id="title">





Semantically this is perhaps better :


    <li id="title">








Thus the code will become :


lib.navleft.header = HMENU
lib.navleft.header {
special = rootline
special.range = 1|1
wrap = <li id="title">|
1 = TMENU
1 {
NO {
doNotLinkIt = 0
ATagTitle.field = description // title
stdWrap.htmlSpecialChars = 1
}
}
}

lib.navleft = COA
lib.navleft {
wrap = <div id="submenu">
    |
</div>

10 < lib.navleft.header

20 = HMENU
20 {
entryLevel = 1
1 = TMENU
1.wrap =
    |

1 {
NO {
wrapItemAndSub = |
ATagTitle.field = description // title
stdWrap.htmlSpecialChars = 1
}

CUR < .NO
CUR = 1
CUR {
wrapItemAndSub = <li id="active">|
doNotLinkIt = 1
}
}

2 < .1
3 < .1
4 < .1
}
}
By Jacco Van der+Post on Friday, May 28, 2010 9:21 AM EDT
Gravatar: Jacco Van der+Post Seem the comment function messed up the code. Anyways what I meant was that the title should be higher in the unordered list and the menu items in an UL in the LI of the title.