Ted Logan
Ted Logan

Reputation: 414

Get the image path in fluid

in my fluid template I create an image with

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

Is there a way to get just the path of the image like "domain.com/path.jpg" ?

Edit: {post.teaserAssetsSquare.0.originalResource.publicUrl} is the relative path for the image. But the domain is still missing

Upvotes: 3

Views: 4426

Answers (1)

Pravin Vavadiya
Pravin Vavadiya

Reputation: 3207

I think you need to just add this paths in your fluid template like below. you don't need to add your domain name. You domain name will be automatically added in your paths.

Just added absolute = '1' for full paths.

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

Or try to below for absolute paths.

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

For get just image paths.

<f:uri.image image="{post.teaserAssetsSquare.0}" width="400" height="375" absolute="1" />

Upvotes: 5

Related Questions