[TYPO3-english] How do you generate a menu where every menu item has its own image, using DAM?

Oliver Salzburg oliver.salzburg at googlemail.com
Wed Jul 11 20:48:23 CEST 2012


On a clients website, they have a certain navigation elements which I
plan to replace with a proper TYPO3 menu. But it's proving to be quite
a challenge.

- The menu should contain all sub-pages of the page currently being
  viewed.
- Every menu item should be rendered with an image that was previously
  "linked" with the page.
  - This image must be sourced from DAM so we can make use of file
    references rather than copies.

I solved my first requirement by using:

	lib.content = HMENU
	lib.content {
	  special = directory
	  special.value.data = page:id

So far, so good.

Now the image part boils down to:
	10 = IMAGE
	10 {
	  file {
	    import.cObject = USER
	    import.cObject {
	      userFunc = tx_dam_pages->get_media_file
	      listNum  = 0
	      slide    = 1
	    }
	  }
	}

At least, that's the example code from EXT:dam_pages, which I use to
link DAM records with pages. And it works great, as long as I pass a
constant uid to it (not shown in the above code).

So how do I get the page ID in there?

This is very frustrating, because an approach *without* DAM works
perfectly. As suggested here:
http://www.typo3-addict.com/2008/11/gmenu-with-a-different-image-for-each-menu-item/

But that is simply not an option due to the default file handling
behavior of TYPO3.

Cheers
Oliver


More information about the TYPO3-english mailing list