Jump to content
Manaus

image->url path and image real url

Recommended Posts

Hello,

I noticed that for geting the image right url I have to print two values

<? foreach ($page->children as $child): ?>
  <img src="<?php echo $child->image->url, $child->image ?>" alt="" />
<? endforeach ?>

Is this the normal usage, or am I skipping some important part?

Thanks!

Share this post


Link to post
Share on other sites

The ->url should get you the full – relative to root folder – url to the image. 

Share this post


Link to post
Share on other sites
$child->image->url

If this only does give you the path to the folder, your image field is multiple and not a single image field.

If you change your field to only allow 1 image, then this would give you the full url to the image.

  • Like 5

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...