Project

General

Profile

Actions

Bug #71994

closed

Fluid Styled Content doesn't support rendering PDF previews in Upload-List

Added by Florian Schaeffer over 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid Styled Content
Start date:
2015-12-01
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

The Upload.html - fluid template uses f:image to render the preview instead of f:media (like it is done in Text & Media). The result is a link surrounding an image tag which has a direct src="<correctfilename>.pdf" attribute.

By exchanging the fluid-Template (and using f:media instead of f:image the PDF preview is rendered correctly.

Old Resources/Private/Templates/Content/Upload.html:

                    <f:if condition="{data.uploads_type} == 2">
                        <f:if condition="{f:uri.image(src: 'file:{f:if(condition: file.originalFile, then: \'file:{file.originalFile.uid}\', else: \'file:{file.uid}\')}')} != '/'">
                            <f:then>
                                <a href="{file.publicUrl}">
                                    <f:image src="{file.uid}" treatIdAsReference="{f:if(condition: file.originalFile, then: '1', else: '0')}" width="150" alt="{file.properties.alternative}" />
                                </a>
                            </f:then>
                            <f:else>
                                <img src="{f:uri.resource(path: 'Icons/FileIcons/{file.extension}.gif', extensionName: 'frontend')}" alt="">
                            </f:else>
                        </f:if>
                    </f:if>

New:

                    <f:if condition="{data.uploads_type} == 2">
                        <f:if condition="{f:uri.image(src: 'file:{f:if(condition: file.originalFile, then: \'file:{file.originalFile.uid}\', else: \'file:{file.uid}\')}')} != '/'">
                            <f:then>
                                <a href="{file.publicUrl}">
                                    <f:media file="{file}" width="150" alt="{file.properties.alternative}" />
                                </a>
                            </f:then>
                            <f:else>
                                <img src="{f:uri.resource(path: 'Icons/FileIcons/{file.extension}.gif', extensionName: 'frontend')}" alt="">
                            </f:else>
                        </f:if>
                    </f:if>


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #71502: Fluid Styled Content does not render PDFs in frontend.ClosedLars Peter Søndergaard2015-11-12

Actions
Actions

Also available in: Atom PDF