rushy Posted August 20, 2017 Share Posted August 20, 2017 Hi I can't retrieve the description field of an image. I follow the example below from the API : http://processwire.com/api/fieldtypes/images/ scroll down to Image Properties heading, below that it says that "Here are all the image properties that are present with every image:" I have created a field of type images, and added it to my template, loaded an image, and in my page it displays fine. I added a description text in the description field and also tried in the template (override option) but it is always blank. Any ideas? I must be missing something simple here? I'm using the latest version of PW. echo "<img src='$image->url' alt='$image->description' />"; Link to comment Share on other sites More sharing options...
bernhard Posted August 20, 2017 Share Posted August 20, 2017 hi rushy, maybe i'm misunderstanding you but it sounds like you are trying to display the description of the FIELD and not the description of the IMAGE? you do not have a template override option for image descriptions... this is where you put the description of your images: 2 Link to comment Share on other sites More sharing options...
abdus Posted August 20, 2017 Share Posted August 20, 2017 3 hours ago, rushy said: echo "<img src='$image->url' alt='$image->description' />"; Can you give a bit more context to this piece of code? Where does $image come from? Does image display on the front end (or does url show up correctly)? 1 Link to comment Share on other sites More sharing options...
rushy Posted August 20, 2017 Author Share Posted August 20, 2017 Hi Bernhard and also abdus Thanks for your reply guys. I have found the place to enter the image description is when loading the image in the page. The image description field is hidden unless you select the edit mode or 3rd option for thumbnail display as shown below. So I was putting my text in the wrong place. Now it works fine! 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