justnew77 Posted September 13, 2013 Share Posted September 13, 2013 Hello, I follow the instructions on this site how to deal with Image fields: I generateed an field with the Name "themeimage" as type IMAGE, I put it to the template, and I put this code to the template file: if($page->themeimage) echo "<img src='{$page->themeimage->url}'>"; I load up an Image inside the page but the image do not apear?! This is what it renders out: <img src='/dev/site/assets/files/1/'> Link to comment Share on other sites More sharing options...
adrian Posted September 13, 2013 Share Posted September 13, 2013 This is a recurring issue for those new to PW. Your images field is by default set to handle more than one image, so you can either change it to only support one image, or you need to define which image from the field you want to display: if($page->themeimage) echo "<img src='{$page->themeimage->first()->url}'>"; Or replace first() with last() or eq(n) where n is the number of the image in the order, starting with 0. To change the image field to only support one image, go to the field's details tab and change Maximum files allowed to: 1 Link to comment Share on other sites More sharing options...
justnew77 Posted September 13, 2013 Author Share Posted September 13, 2013 Ok, Thank you very much Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now