[TYPO3-english] FAL ignores localized images...(TYPO3 6.2.9) [SOLVED]

Bert Hiddink [BENDOO e-work solutions] hiddink at bendoo.nl
Tue May 19 10:37:38 CEST 2015


Hello!

Found out that the viewhelper-function got updated in the latest version 
which addresses the problem:


	public function render($data, $as = 'items', $table = 'tt_content', 
$field = 'image') {
		if (is_array($data) && $data['uid'] && $data[$field]) {
			$this->fileRepository = 
GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository');
			$items = $this->fileRepository->findByRelation($table, $field, 
$data['uid']);
			$localizedId = NULL;
			if (isset($data['_LOCALIZED_UID'])) {
				$localizedId = $data['_LOCALIZED_UID'];
			} elseif (isset($data['_PAGES_OVERLAY_UID'])) {
				$localizedId = $data['_PAGES_OVERLAY_UID'];
			}
			$isTableLocalizable = (
				!empty($GLOBALS['TCA'][$table]['ctrl']['languageField'])
				&& !empty($GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'])
			);
			if ($isTableLocalizable && $localizedId !== NULL) {
				$items = $this->fileRepository->findByRelation($table, $field, 
$localizedId);
			}
		} else {
			$items = NULL;
		}
		$this->templateVariableContainer->add($as, $items);
		$content = $this->renderChildren();
		$this->templateVariableContainer->remove($as);
		return $content;
	}

Works great now!

Regards,
Bert

On 5/18/15 12:17 PM, Bert Hiddink [BENDOO e-work solutions] wrote:
> Hello,
>
> I am using the Introduction package in a multilanguage context.
>
> When displaying images in the front-end, FAL seems to ignore localized
> images (only the images for the default lang are shown for other
> languages than default...
>
> The fluid-snippet is this:
>
> <bk2k:fal data="{data}" as="images" field="image">
>      <f:if condition="{images}">
>          <f:for each="{images}" as="image" iteration="iteration">
>              <f:image src="{image.uid}" treatIdAsReference="1" />
>          </f:for>
>      </f:if>
> </bk2k:fal>
>
>
> The viewhelper-function is which is called by the snippet is this:
>
>      public function render($data,$as = 'items', $table = 'tt_content',
> $field = 'image') {
>          if(is_array($data) && $data['uid'] && $data[$field]){
>              $this->fileRepository =
> GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository');
>              $items = $this->fileRepository->findByRelation($table,
> $field, $data['uid']);
>          }else{
>              $items = NULL;
>          }
>          $this->templateVariableContainer->add($as, $items);
>          $content = $this->renderChildren();
>          $this->templateVariableContainer->remove($as);
>
>          return $content;
>
>      }
>
> Any ideas how to resolve this?
>
> Thanks in advance!
>
> Regards,
> Bert
>



More information about the TYPO3-english mailing list