Static header or footer navigation with TypoScript

Jan 10, 2012
lib.nav.top and search box

Creating inline, static header or footer navigation for your TYPO3 website is easy.

Just copy and paste the following TypoScript code into your TypoScript template’s Setup section and then call lib.nav.top as needed into your TemplaVoila or TypoScript page template to create your own static header navigation.

You can adjust what pages show by changing the PIDs in lib.nav.top.special.value.

lib.nav.top = HMENU
lib.nav.top {
	special = list
	special.value = 22, 91, 20, 32
	1 = TMENU
	1 {
		NO {
			linkWrap = | | |*||*| |
			ATagTitle.field = description // title
			stdWrap.htmlSpecialChars = 1
		}

		CUR < .NO
		CUR = 1
		CUR {
			doNotLinkIt = 1
			stdWrap.wrap = <span id="current">|</span>
		}
	}
}

# search box appending
temp.lib.nav.top < lib.nav.top
lib.nav.top >

lib.nav.top = COA
lib.nav.top {
	10 < temp.lib.nav.top
	20 < lib.static.search
}

What About My Footer?

Instead of copying and pasting all of lib.nav.top again into a lib.nav.footer, you can reuse lib.nav.top with the power of TypoScript.

lib.nav.footer < lib.nav.top
lib.nav.footer.special.value = 39, 40, 41

Related Links

Related Entries

Donate for Good Karma

Your donation helps enable Aihrus's volunteer efforts towards mentoring young developers and supporting Open Source projects.

TYPO3, logo, bronze member

No money? Leave a testimonial for Aihrus instead.

×

Log In


Need an account? Register
Forgot your password? Recover

Guest Purchase?

If you purchased as a guest, then you need to convert to a real account before accessing your purchases.

×

Register


Already registered? Log In

×