Jump to content

Image error


smngy
 Share

Recommended Posts

Hi, I’m pretty new to PW/php so be gentle.

I have a project page which displays the fields title and images.

I’m trying to output the content of the images field using:

<?php
$image = $page->images;
echo "<img src='{$image->url}' />";
?>

What returns when I view the rendered page is the url of the directory where the file is without the actual file name in it.

I tried

echo "<img src='{$image}' />";

as well but then I just get the name of the file rather than the full url to the file on my server. What am I doing wrong?

Please and thank you.

Seán

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...