donators

n@work Internet Informationssysteme GmbH
Your ad here

supported by

 TYPO3 Hamburg
 TYPO3 Anbieter

Advertising

An easy way to image menus

By: Thomas

14.04.07 10:20 Age: 1 yrs

I want to create a menu with TYPO3 with images, but I don't want any creating or processing.

This is very easy to achieve. The following TypoScript creates a menu that creates a an image tage instead of a simple text. The images are located in the fileadmin directory.

  1.  
  2. lib.navIcon = HMENU
  3. lib.navIcon    {
  4.   special = directory
  5.   special.value = 183
  6.   1 = TMENU
  7.   1    {
  8.     noBlur = 1
  9.     NO    {
  10.       allWrap = |<br />
  11.       stdWrap.cObject = COA
  12.       stdWrap.cObject    {
  13.         10 = TEXT
  14.         10.wrap = <img src="fileadmin/templates/images/icon_|.gif" alt="
  15.         10.data = field:alias
  16.                
  17.         20 = TEXT
  18.         20.wrap = |"
  19.         20.data = field:subtitle
  20.                
  21.         30 = TEXT
  22.         30.wrap = title="|" />
  23.         30.data = field:subtitle
  24.       }
  25.     }
  26.   }
  27. }
  28.  

The alt and title attribute of the image are filled with the alias and subtitle of the page that is linked. You can see the result in the top right corner of this page.

Found a mistake?

If you found a mistake or if you have a good tip or suggestion, please contact me at thomas(at)typo3-unleashed.net. I will check it and correct the entry or insert the new one.

Thanks in advance for your help.