Jump to content

Template update


angelo, italy
 Share

Recommended Posts

Hi!

I did it, my code is

<img class="img-responsive"   src="<?php echo $page->headimage->url?>" />

but imags don't appear!

If I analyze code in the front using google console I saw this code

<img class="img-responsive" src="/processwire-master/site/assets/files/1/">

.. it seems to stop in the folder without getting image's url..

 

?

Schermata 2019-04-16 alle 09.40.43.png

Schermata 2019-04-16 alle 09.40.58.png

Link to comment
Share on other sites

Is this field set up to only accept one image or multiple? And what did you define in the output settings? (single image or multiple, string or array)

8 hours ago, angelo, italy said:

<img class="img-responsive"   src="<?php echo $page->headimage->url?>" />

 

You would use this if you only allow one single image.

But in your screenshot I see multiple images.

In that case, you would rather use something like $page->headimage->first()->url to get the first image only.

  • Like 1
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

×
×
  • Create New...