Created
June 11, 2025 13:18
-
-
Save Schweriner/9f252341bd5a131c82db32cdf520ee64 to your computer and use it in GitHub Desktop.
using the core:icon Viewhelper to differ PDF/IMAGE/OTHERS (example of SfEvent)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <f:for each="{event.files}" as="file"> | |
| <li class="mb-1"> | |
| <span class="icon text-small"> | |
| <f:if condition="{file.originalResource.extension}=='pdf'"> | |
| <f:then> | |
| <core:icon identifier="actions-file-pdf" /> | |
| </f:then> | |
| <f:else if="{file.originalResource.type}==2"> | |
| <core:icon identifier="actions-file-image" /> | |
| </f:else> | |
| <f:else> | |
| <core:icon identifier="actions-file" /> | |
| </f:else> | |
| </f:if> | |
| </span> | |
| <f:if condition="{file.originalResource.title}"> | |
| <f:then> | |
| <a href="{file.originalResource.publicUrl}" target="_blank">{file.originalResource.title}</a> | |
| </f:then> | |
| <f:else> | |
| <a href="{file.originalResource.publicUrl}" target="_blank">{file.originalResource.name}</a> | |
| </f:else> | |
| </f:if> | |
| </li> | |
| </f:for> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment