After Lockdown
Downloads
An error occurred while processing the template.
The following has evaluated to null or missing: ==> fileExtension [in template "5177089#20128#91503" at line 27, column 83] ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${fileExtension} [in template "5177089#20128#91503" at line 27, column 81] ----
1<#assign dlFileEntry = serviceLocator.findService("com.liferay.document.library.kernel.service.DLFileEntryLocalService")>
2
3<#if file.getSiblings()?has_content>
4<ol class="lbs-downloads">
5
6 <#list file.getSiblings() as cur_file>
7 <#list cur_file.getData()?split("/") as x>
8 <#if x?counter ==3>
9 <#assign groupId = x?number>
10 </#if>
11
12 <#if x?counter ==6>
13 <#assign uuId = x?keep_before("?")>
14 </#if>
15 </#list>
16 <#if (uuId??) && (groupId??)>
17 <#assign file = dlFileEntry.getFileEntryByUuidAndGroupId(uuId,groupId) > <#-- dlFileEntry object - holds more data-->
18 <#assign fileSizeInMB = (file.getSize()/1000000)?string["0.##"] > <#--will return file size in MB-->
19 <#assign fileExtension = file.getExtension()> <#--extension-->
20 </#if>
21 <li class="lbs-downloads--item">
22 <a href="${cur_file.getData()}" class="lbs-downloads--link">
23 ${cur_file.title.getData()}
24 </a>
25 <ul class="lbs-downloads--meta">
26 <li class="lbs-downloads--extension">
27 <span class="govuk-visually-hidden">Document format:</span> ${fileExtension}
28 </li>
29 <li class="lbs-downloads--extension">
30 <span class="govuk-visually-hidden">Document size:</span> ${fileSizeInMB}MB
31 </li>
32 <li>
33 <a href="${cur_file.getData()}" download>
34 Download <span class="govuk-visually-hidden">${cur_file.title.getData()}</span>
35 </a>
36 </li>
37 </ul>
38 </li>
39 </#list>
40 </ol>
41</#if>
Help us improve our site by joining our user research panel