[TYPO3-english] problem with an own image for page menu

bernd wilke t3ng at bernd-wilke.net
Wed Jun 24 09:48:00 CEST 2015


Am 23.06.15 um 23:40 schrieb Jan Bednarik:
> Hi,
>
> try it with FILES object:
>
> lib.follow = HMENU
> lib.follow {
>    special = directory
>    special.value = 31
>    1 = TMENU
>    1 {
>      wrap = <ul>|</ul>
>      NO.ATagTitle.field = title
>      NO.allWrap = <li>|</li>
>      NO.stdWrap.override.cObject = FILES
>      NO.stdWrap.override.cObject {
>        references {
>          table = pages
>          uid.data = field:uid
>          fieldName = media
>          maxItems = 1
>        }
>        renderObj = IMAGE
>        renderObj {
>          file.import.data = file:current:uid
>          file.treatIdAsReference = 1
>        }
>      }
>    }
> }

that might be possible, but why do I need to use such a big detour?
building up another query for values already available will slow down 
page generation unneccessary

As I said: working with the field 'media' works the easy way.
replacing the fieldname to my own (which is declared in nearly the same 
way) does not work

> Jan
>
> Dne 23. 6. 2015 v 16:53 bernd wilke napsal(a):
>> I have a problem with a menu and FAL: I defined a new field for the
>> image and use the following TS.
>> all fields (25,30) get inserted, but no image-path/name (20) appears, 15
>> returns 1 if active
>>
>>
>>            10 = COA
>>              10 {
>>                stdWrap.wrap = <div class="image-container">|</div>
>>                10 = TEXT
>>                10.value = &lt;img class="img-polaroid"
>> src="//{$imageserver}
>>
>>                #15 = TEXT
>>                #15.field = tx_myext_logo11
>>                #15.wrap = [|]
>>
>>                20 = IMG_RESOURCE
>>                20 {
>>                  file {
>>                    import {
>>                      field = tx_myext_logo11
>>                      listNum = 0
>>                    }
>>                    treatIdAsReference = 1
>>                  }
>>                }
>>
>>                25 = TEXT
>>                25.field = title
>>                25.wrap = " title="|
>>
>>                30 = TEXT
>>                30.value = " alt="|"
>>
>>                40 = TEXT
>>                40.value = />
>>                40.noTrimWrap = | ||
>>              }
>>            }
>>
>> more strange:
>> if I change the field to media
>>                20 = IMG_RESOURCE
>>                20 {
>>                  file {
>>                    import {
>>                      field = media
>>                      listNum = 0
>>                    }
>>                    treatIdAsReference = 1
>>                  }
>>                }
>> the image(path) inserted there is shown.
>> my field has nearly the same TCA-definition than media.
>> tx_myext_logo11 is restricted to images,
>> media has an array entry for foreign_types
>>
>> any other configuration needed?
>>
>> bernd
>

bernd
-- 
http://www.pi-phi.de/cheatsheet.html


More information about the TYPO3-english mailing list