Feature #78347

FilesProcessor should support data (especially for level fields)

Added by Andreas Allacher about 4 years ago. Updated 9 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid Styled Content
Target version:
-
Start date:
2016-10-19
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Currently the FilesProcessor cannot be used to add references from level-fields because it only retrieves data by fieldName and tableName.
It would be nice if the FilesProcessor also supports levelmedia and other level* data options.

That way the processor could be used on a page FLUIDTEMPLATE to render e.g. a slideshow by using levelmedia.

#1

Updated by Wouter Wolters about 4 years ago

  • Category changed from Fluid to Fluid Styled Content
#2

Updated by Stefan Froemken about 1 year ago

Today I had the same problem and tried to solve it that way:

20 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
  20 {
    files.cObject = FILES
    files.cObject {
      references.data = levelmedia: -1, slide
      begin = 0
      maxItems = 1
      renderObj = TEXT
      renderObj.dataWrap = {file:current:originalUid},
    }
    as = headerimages
  }

But that way, you don't have any crop information anymore in your FluidTemplate

Stefan

#3

Updated by Stefan Froemken about 1 year ago

In FilesContentObject it is already solved with:

$referencesUidList = $this->cObj->stdWrapValue('references', $conf);
$referencesUids = GeneralUtility::intExplode(',', $referencesUidList, true);
$fileCollector->addFileReferences($referencesUids);
#4

Updated by Gerrit Code Review about 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62098

#5

Updated by Gerrit Code Review about 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62098

#6

Updated by Stefan Froemken about 1 year ago

OK...with my patch you can do following now:

# Default PAGE object:
page = PAGE
page.10 = FLUIDTEMPLATE
page.10 {
  dataProcessing {
    10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
    10 {
      references.fieldName = media
      references.table = pages
      as = headerImages
    }
    20 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
    20 {
      references.data = LEVELMEDIA: -1, slide
      as = otherImages
    }
  }
  templateName = Default
  layoutRootPaths {
    10 = EXT:site_package/Resources/Private/Layouts
  }
  partialRootPaths {
    10 = EXT:site_package/Resources/Private/Partials
  }
  templateRootPaths {
    10 = EXT:site_package/Resources/Private/Templates
  }
  variables {
    content < styles.content.get
  }
}

{headerImage} will only contain an image, if there is an image assigned in page properties of current site. No slide possible. {otherImage} will always find an image, as long as you have configures an image on root site.

Would be cool to have that missing Feature/Bugfix in TYPO3 9.5, too.

Stefan

#7

Updated by Gerrit Code Review about 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62098

#8

Updated by Gerrit Code Review about 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62098

#9

Updated by Gerrit Code Review 11 months ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62098

#10

Updated by Stefan Froemken 10 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#11

Updated by Benni Mack 9 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF