-->

Typo3 FCE refer a field inside a container field

2019-06-03 14:53发布

问题:

Here is the screen shot of mapping of my FCE:

I can refer 'Caption' field by 'field_caption' from the typoscript of 'Link' field.

Here is the typoscript for that:

    10 = TEXT
    10.field = field_caption

How to refer the 'Image' field which is inside a container field 'Image and alternate text' From the typoscript of 'Link' field?

I tried to refer it directly by using 'field_image', but it is not working.

here is the screen shot:

Markup I am trying to map is:

    <a href="resources/img/site/demo1.jpg">
      <img src="resources/img/site/demo1.jpg" alt="alternate text" />
      <div class="flex-caption">
        <p>caption text</p>
      </div>
    </a>

回答1:

Ok, you want to wrap the image with a link. Actually you have to do it the other way round.

In my case the span link has display:none; because it's my link placeholder. In your scenario it is field_link.

Now click to edit your field_image and click on data processing. Edit TS Code:

10 = IMAGE
10.file.XY = 200,150
10.file.import = uploads/tx_templavoila/

10.stdWrap.typolink.parameter.field = link

This last line wraps the image with a link. In your case it would be

10.stdWrap.typolink.parameter.field = field_link