Thursday, 15 August 2013

typo3 - Extbase FAL file download -



typo3 - Extbase FAL file download -

i have question file download extbase , fal. can render image

<f:image src="{file.uid}" alt="" width='100' height="100" treatidasreference="1"/>

i can image, have pdf file download, , can't utilize viewhelper. there other viewhelper file downloads? if dump file this:

file => typo3\cms\extbase\domain\model\filereferenceprototypepersistent entity (uid=1342, pid=310) originalresource => null uid => 1342 (integer) _localizeduid => 1342 (integer)modified _languageuid => 0 (integer)modified pid => 310 (integer)

originalresource null file, , image, image printed viewhelper. , can't file...

any help welcome...

you can utilize publicurl property of originalresource create file link.

sample fluid generate list of files referenced in domain model property

<ul class="download-list"> <f:for each="{myobject.myfalproperty}" as="file" > <li><a href="{file.originalresource.publicurl}">{file.originalresource.title}</a></li> </f:for> </ul>

just utilize {myobject.myfalproperty} see can access.

if need more properties here basics of original , reference in case want utilize override located in flexform

original attributes

filename :{myobject.myfalproperty.originalresource.originalfile.name} title:{myobject.myfalproperty.originalresource.originalfile.title} description:{myobject.myfalproperty.originalresource.originalfile.description} alt:{myobject.myfalproperty.originalresource.originalfile.alternative} uid:{myobject.myfalproperty.originalresource.originalfile.uid} path:{myobject.myfalproperty.originalresource.publicurl}

reference attributes

title: {myobject.myfalproperty.originalresource.title} description {myobject.myfalproperty.originalresource.description}

hope helps.

just reference according tca looks like, know (note sample has maxitems setting of 10:

'myfalproperty' => array( 'exclude' => 0, 'label' => 'lll:ext:xy_sample/resources/private/language/locallang_db.xlf:tx_xysample_domain_model_myobject.myfalproperty', 'config' => \typo3\cms\core\utility\extensionmanagementutility::getfilefieldtcaconfig( 'myfalproperty', array('maxitems' => 10) ), ),

typo3 fluid extbase

No comments:

Post a Comment