forked from cms/tibi-svelte-starter
Collection für Content angepasst. Image Components erweitert. Verschiedene CSS Apassungen der Demo Page
This commit is contained in:
@@ -1,9 +1,21 @@
|
||||
<script lang="ts">
|
||||
import { apiBaseURL } from "../../config"
|
||||
|
||||
export let collectionName: string = null
|
||||
export let entryId: string = null
|
||||
export let file: File = null
|
||||
export let alt: string = ""
|
||||
export let cssClass: string = ""
|
||||
</script>
|
||||
|
||||
{#if file}
|
||||
<img src="{file.src}" alt="{alt ? alt + ' - ' : ''}{file.path}" class="{cssClass}" />
|
||||
{#if collectionName && entryId && file}
|
||||
{#if file.src.includes(";base64,")}
|
||||
<img src="{file.src}" alt="{alt ? alt + ' - ' : ''}{file.path}" class="{cssClass}" />
|
||||
{:else}
|
||||
<img
|
||||
src="{`${apiBaseURL}${collectionName}/${entryId}/${file.src}?filter=l`}"
|
||||
alt="{alt ? alt : file.path}"
|
||||
class="{cssClass}"
|
||||
/>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user