[TYPO3] icon on a menuitem

JoH asenau info at cybercraft.de
Wed Jan 10 12:22:36 CET 2007


> Need to add an icon to one particular menu-item in a GMENU.
>
> menuitem 1
> menuitem 2 + icon
> menuitem 3
> ...
> a.s.o
>
> I've tried to solve this by adding a section:
> 30 = IMAGE
> 30 {
>     file = ...
>     if {
>       value = 83,99,121
>       isInList.data = page:uid
>     }
> }
>
> But this doesn't seem to work. I got icons on every menuitem.
>
> Do I really have to make a "fakemenu " to solve this, or do I just
> missed a simple point?

Why don't you use the "media" field of the specific page and upload the icon
there.
Then you create the image only if there is a file available.

30 = IMAGE
30 {
    file {
        import = uploads/media/
        import.field = media
        import.listNum = 0
    }
}

No "if" necessary, since the IMAGE element will render only, if there really
is an image in the media field.

This way you can easily add other icons to other pages without ever touching
the TS code again.

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC/Xing: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com




More information about the TYPO3-english mailing list