Project

General

Profile

Actions

Feature #78347

closed

FilesProcessor should support data (especially for level fields)

Added by Andreas Allacher about 8 years ago. Updated over 3 years 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.

Actions #1

Updated by Wouter Wolters about 8 years ago

  • Category changed from Fluid to Fluid Styled Content
Actions #2

Updated by Stefan Froemken about 5 years 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

Actions #3

Updated by Stefan Froemken about 5 years ago

In FilesContentObject it is already solved with:

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

Updated by Gerrit Code Review about 5 years 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

Actions #5

Updated by Gerrit Code Review about 5 years 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

Actions #6

Updated by Stefan Froemken about 5 years 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

Actions #7

Updated by Gerrit Code Review about 5 years 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

Actions #8

Updated by Gerrit Code Review about 5 years 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

Actions #9

Updated by Gerrit Code Review almost 5 years 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

Actions #10

Updated by Stefan Froemken almost 5 years ago

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

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions #12

Updated by Anonymous over 3 years ago

This is awesome work, Stefan!

Actions

Also available in: Atom PDF