Typo3: Using Page Alias And Other Page Record Fields in TMENU Menus

Submitted by Hannes Schmidt on Sun, 11/28/2004 - 14:45.

Problem: Your web site uses the Typo3 CMS. Your typoscript templates contains TMENU objects for navigation menus. You want to use the page alias somewhere in the A tags of these TMENU menus. For example, you want to set the id of a menu item's A tag to the alias field of the page that the menu item stands for.

<a id="widgets" href="...">Buy Widgets</a>

Buy Widgets is the title of the page and widgets is its alias.

Solution: Use the following TypoScript in your template:

temp.menu.1 = TMENU
temp.menu.1 {
	NO.ATagParams = id="{field:alias}"
	NO.allStdWrap.insertData = 1
}

Explanation: NO.allStdWrap.insertData = 1 makes Typo3 replace text in curly brackets {} with the value of page record fields. Hence, {field:alias} is replaced by the alias of the current menu item's target page.

Why this article? I had the above problem but I only found more complex solutions that didn't appeal to me because they hardcode the A tag. I like the Typo3 generated A tag because it contains a nifty JavaScript snippet that prevents the ugly dotted rectangle being drawn around the link when it's foucsed (blurLink). subst_elementUid is a similar typoscript hack but it uses the numeric uid instead of the alias. Besides, the solution described here is more versatile.

( categories: Typo3 | Webmaster )
Submitted by Hannes Schmidt on Fri, 12/03/2004 - 06:52.

Well, in addition to Drupal and Typo I also have a Plone installation running for a client of mine. I like playing around with different systems. For Diary Products I wanted a CMS that I could get up and running quickly but I didn't need Typo3's power and flexibility.

OTOH, there are two things I find a little annoying about Drupal:

  • It's hard to find definitive answers to technical and administrative questions on drupal.org and
  • Drupal still doesn't have node level permissions although drupal.org suggests that the opposite is true for the 4.5 releases.
Submitted by Anonymous on Tue, 11/30/2004 - 11:51.

You give Typo3 pointers on a drupal powered site. Care to share how you came to this setup?

-Tim