[TYPO3-english] Menu with images with alt and title

Jan Bednarik info at bednarik.org
Thu Nov 19 19:24:22 CET 2015


Hi Jou jou,

you need to render image that is a reference like this:

before.cObject = FILES
     before.cObject {
       references {
         table = pages
         uid.data = field:uid
         fieldName = media
         maxItems = 1
       }
       renderObj = IMAGE
       renderObj {
         file.import.data = file:current:uid
         file.treatIdAsReference = 1
       }
     }

I'm not sure, but file:current:title could contain the title you're 
looking for.

Jan



Dne 17.11.2015 v 16:59 joujou napsal(a):
> Hi,
> I'm trying to make a menu with images but I don't know how to set the
> alt and title attributes of the images, grabbing which I've written for
> the image (the image is a resource for a page).
> Here is my code, with question tags where I don't know what to write :
>
>
> tt_content.menu.20.99 = HMENU
> tt_content.menu.20.99 {
> special = directory
> special.value.field = pages
> wrap = <div class="csc-menu-images">|</div>
> 1 = TMENU
> 1.noBlur = 1
> 1.NO {
>   allWrap = <div class="csc-menu-item">|</div>
>   linkWrap = <div class="csc-menu-images-link">|</div>
>   before.cObject = IMAGE
>     before.cObject.file.import = uploads/media/
>     before.cObject.file.import.field = media
>     before.cObject.file.import.listNum = 0
>     before.cObject.altText = ??????
>     before.cObject.titleText = ??????
>     before.cObject.stdWrap.typolink.parameter.field = uid
>     beforeWrap = <div class="csc-menu-images-image">|</div>
>
>     after = TEXT
>     after {
>         data = field : abstract // field : description // field : subtitle
>         wrap = <div class="csc-menu-images-abstract">|</div><div
> class="csc-menu-img-clear"></div>
>     }
>   }
>   2 < .1
> }
>
> Thanks a lot



More information about the TYPO3-english mailing list