获取流畅的图像路径

问题描述 投票:1回答:1

在我的流体模板中,我创建了一个图像

<f:media file=" {post.teaserAssetsWide.0}" width="708" height="398" />

有没有办法像“domain.com/path.jpg”那样获得图像的路径?

编辑:{post.teaserAssetsSquare.0.originalResource.publicUrl}是图像的相对路径。但该域仍然缺失

image typo3 fluid
1个回答
1
投票

我认为您需要在流体模板中添加此路径,如下所示。您无需添加域名。您的域名将自动添加到您的路径中。

刚刚添加了absolute = '1'的完整路径。

<f:image src="{object.image.originalResource.publicUrl}" alt="{object.image.originalResource.title}" width="640" height="291" treatIdAsReference="1" />

或者尝试下面的绝对路径。

<f:image image="{post.teaserAssetsSquare.0}" title="{post.teaserAssetsSquare.0.originalResource.title}" absolute="1" />

只获取图像路径。

<f:uri.image image="{post.teaserAssetsSquare.0}" width="400" height="375" absolute="1" />
© www.soinside.com 2019 - 2024. All rights reserved.