Jump to content

Use of description field in image


rushy
 Share

Recommended Posts

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

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:

599996bfcb091_2017-08-2016_03_23-EditPage_SpieltermineHerbst2017sv-tuernitz_at.png.d7dabfabf6863b3dabc4793c10fd0645.png

  • Like 2
Link to comment
Share on other sites

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)?

  • Like 1
Link to comment
Share on other sites

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!

5999aced45314_Screenshotfrom2017-08-20173316.thumb.png.421ad2bd9b46db2716ff9b74ded167a8.png

 

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...