{if $object->isPlainUrl()}
<a {anchorAttributes url=$object->url isUgc=$enableUgc}>{$object->title}</a>
{else}
- <div class="
- unfurlUrlCard
- {if $object->hasCoverImage()}unfurlUrlCardCoverImage{/if}
- {if $object->hasSquaredImage()}unfurlUrlCardSquaredImage{/if}
- ">
-
- <div class="unfurlUrlImage"{if !$object->getImageUrl()|empty} style="background-image: url('{$object->getImageUrl()}')"{/if}></div>
+ <div class="unfurlUrlCard{*
+ *}{if $object->hasCoverImage()} unfurlUrlCardCoverImage{/if}{*
+ *}{if $object->hasSquaredImage()} unfurlUrlCardSquaredImage{/if}{*
+ *}">
+ {if !$object->getImageUrl()|empty}
+ <img src="{$object->getImageUrl()}" height="{$object->height}" width="{$object->width}" class="unfurlUrlImage" alt="" loading="lazy">
+ {/if}
<div class="unfurlUrlInformation">
<div class="unfurlUrlTitle">{$object->title}</div>
<div class="unfurlUrlDescription">{$object->description}</div>
width: 400px;
.unfurlUrlImage {
- height: 200px;
- position: relative;
+ /* The `!important` is required because of `.messageBody > .messageText img`. */
+ height: 200px !important;
+ object-fit: cover;
+ object-position: center;
+ width: 600px;
}
}
.unfurlUrlImage {
border-radius: 3px;
flex: 0 0 auto;
- height: 128px;
+ /* The `!important` is required because of `.messageBody > .messageText img`. */
+ height: 128px !important;
margin: 10px;
width: 128px;
@include screen-sm {
- height: 64px;
+ height: 64px !important;
width: 64px;
}
@include screen-xs {
- height: 24px;
+ height: 24px !important;
position: absolute;
width: 24px;
}
}
}
-.unfurlUrlImage {
- background-position: center;
- background-repeat: no-repeat;
- background-size: cover;
-}
-
.unfurlUrlInformation {
position: relative;
padding: 10px 10px 25px 10px;