Skip to content

Commit

Permalink
[TASK] Streamline link titles in file uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminkott committed Jul 7, 2023
1 parent 76155e0 commit 6f32e3a
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions Resources/Private/Templates/ContentElements/Uploads.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
<f:if condition="{files}">
<ul class="filelink-list">
<f:for each="{files}" as="file" iteration="fileIterator">
<f:variable name="fileTitle">
<f:if condition="{file.properties.title}">
<f:then>
{file.properties.title} ({f:format.case(value: file.properties.extension, mode: 'lower')})
</f:then>
<f:else>
{file.properties.name}
</f:else>
</f:if>
</f:variable>
<f:variable name="fileTitle">{fileTitle -> f:format.trim()}</f:variable>
<li class="filelink-item">
<f:if condition="{data.uploads_type} == 1">
<div class="filelink-media">
Expand Down Expand Up @@ -35,7 +46,7 @@
<f:if condition="{file -> bk2k:file.isImage()} || {file -> bk2k:file.isMedia()}">
<f:if condition="{f:uri.image(src: 'file:{f:if(condition: file.originalFile, then: \'file:{file.originalFile.uid}\', else: \'file:{file.uid}\')}')} != '/'">
<div class="filelink-media">
<a href="{file.publicUrl}"{f:if(condition: file.properties.title, then: ' title="{file.properties.title}"')}{f:if(condition: data.target, then: ' target="{data.target}"')}>
<a href="{file.publicUrl}" title="{fileTitle}"{f:if(condition: data.target, then: ' target="{data.target}"')}>
<f:media file="{file}" width="{settings.uploads.preview.width}" height="{settings.uploads.preview.height}" alt="{file.properties.alternative}" />
</a>
</div>
Expand All @@ -45,16 +56,8 @@
<div class="filelink-body">
<div class="filelink-heading">
<span class="filelink-filename">
<a href="{file.publicUrl}"{f:if(condition: file.properties.title, then: ' title="{file.properties.title}"')}{f:if(condition: data.target, then: ' target="{data.target}"')}>
<f:if condition="{file.properties.title}">
<f:then>
{file.properties.title}
({f:format.case(value: file.properties.extension, mode: 'lower')})
</f:then>
<f:else>
{file.properties.name}
</f:else>
</f:if>
<a href="{file.publicUrl}" title="{fileTitle}"{f:if(condition: data.target, then: ' target="{data.target}"')}>
{fileTitle}
</a>
</span>
<f:if condition="{data.filelink_size}">
Expand Down

0 comments on commit 6f32e3a

Please sign in to comment.