[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
Thu Jul 12 00:01:29 CEST 2012


On 2012-07-11 23:05, François Suter wrote:
> Hi,
> 
>> My earlier attempts all gave similar results. There is simply no uid
>> passed into it, so it defaults to the current page id:(
> 
> I took a bit of time to reproduce locally the setup I had at the time I
> used this and it's not working for me either anymore.
> 
> Toying a bit further I remembered using a function straight from the DAM
> for this. And indeed it can work, but only if you have a single file
> referenced. Try using:
> 
> NO.before.cObject.file.import.cObject = USER
> NO.before.cObject.file.import.cObject {
>     userFunc = tx_dam_tsfe->fetchFileList
>     refTable = pages
>     refField = tx_dampages_files
> }
> 
> If you have several files, the DAM method will return them in a single
> string, comma-separated. So it's still probably possible to work it out,
> by working some more TS magic using split in a further stdWrap.
> 
> HTH
> 

Wow. I'm amazed.
Initially, I forgot to keep the

    NO.before.cObject = IMAGE

in the code, so it didn't work. And I was already writing up my
response, but wanted to give it another look :D

It works perfectly from what I can tell. But the fact that I don't
really understand why this one works and why my previous approach just
won't, makes me wonder where my misunderstanding of TYPO3 menus is
buried.

Thanks!
Oliver


More information about the TYPO3-english mailing list