[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 22:10:40 CEST 2012


On 2012-07-11 21:53, François Suter wrote:
> Hi Oliver,
> 
>> I'm working off of another menu on the site which a previous dev
>> created, so it might still be incomplete or ugly :P
> 
> In my case I have this code in a somewhat different place, maybe it's
> worth a try, see if it makes a difference:
> 
> tt_content.menu.20.1.1.IFSUB.before {
>     cObject = IMAGE
>     cObject {
>           file {
>               import.cObject = USER
>             import.cObject {
>                 userFunc = tx_dam_pages->get_media_file
>                 listNum=0
>                  slide = 1
>             }
>         }
>     }
> }
> 
> (it's a modification of a sitemap). In you case, it would be placed at:
> 
> NO.before
> 
> instead.
> 
> HTH
> 

Either I am not using that correctly, or it just doesn't work in my
case.

Earlier, I already placed a debug call in get_media_file to see what
uid is passed into it and what uid the method will actually process:
    // gets one media file and returns it directly
    function get_media_file($content,$conf){

    echo "i:".$uid;
        if ($conf['uid']) $uid = $conf['uid'];
        else $uid = $GLOBALS["TSFE"]->id;
    echo "o:".$uid;

The current attempt prints:
i:o:76i:o:76i:o:76i:o:76i:o:76i:o:76i:o:76i:o:76i:o:76

My earlier attempts all gave similar results. There is simply no uid
passed into it, so it defaults to the current page id :(


More information about the TYPO3-english mailing list