获取流体中的图像路径
Get the image path in fluid
在我的流体模板中,我使用
创建图像
<f:media file=" {post.teaserAssetsWide.0}" width="708" height="398" />
有没有办法像 "domain.com/path.jpg" 那样只获取图像的路径?
编辑:{post.teaserAssetsSquare.0.originalResource.publicUrl} 是图像的相对路径。但是域仍然缺失
我认为您只需将此路径添加到您的流体模板中,如下所示。您不需要添加您的域名。您的域名将自动添加到您的路径中。
刚刚为完整路径添加了 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" />
在我的流体模板中,我使用
创建图像<f:media file=" {post.teaserAssetsWide.0}" width="708" height="398" />
有没有办法像 "domain.com/path.jpg" 那样只获取图像的路径?
编辑:{post.teaserAssetsSquare.0.originalResource.publicUrl} 是图像的相对路径。但是域仍然缺失
我认为您只需将此路径添加到您的流体模板中,如下所示。您不需要添加您的域名。您的域名将自动添加到您的路径中。
刚刚为完整路径添加了 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" />