TYPO3 flux: render single image

raw

ImageForeach.html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
     xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
     xmlns:flux="http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers"
     xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers">
  <f:layout name="Content" />
    
  <f:section name="Configuration">
    <flux:form id="teaserlargeimage" options="{group: 'Teaser'}">
      <flux:field.inline.fal name="settings.image" required="1" maxItems="1" minItems="1" collapseAll="1"/>
    </flux:form>
  </f:section>
 
  <f:section name="Main">
    <f:for each="{v:content.resources.fal(field: 'settings.image')}" as="image">
      <f:image treatIdAsReference="1" src="{image.id}" title="{image.title}" alt="{image.alternative}"/>
    </f:for>
  </f:section>
</html>
 
raw

ImageSingle.html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
     xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
     xmlns:flux="http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers"
     xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers">
  <f:layout name="Content" />
    
  <f:section name="Configuration">
    <flux:form id="teaserlargeimage" options="{group: 'Teaser'}">
      <flux:field.inline.fal name="settings.image" required="1" maxItems="1" minItems="1" collapseAll="1"/>
    </flux:form>
  </f:section>
    
  <f:section name="Main">
    {v:content.resources.fal(field: 'settings.image') -> v:iterator.first() -> v:variable.set(name: 'imaged')}
    <f:image treatIdAsReference="1" src="{imaged.id}" title="{image.title}" alt="{image.alternative}"/>
  </f:section>
</html>
 
Christian Weiske Christian Weiske
owner

History