Jump to content
alanxptm

Cannot display image descriptions

Recommended Posts

Hi

Even when it was very intuitive I have read the docs at: https://processwire.com/docs/fields/images/

But still I've been unable to display image descriptions from my testImg field, here's my code:

<?php
	if(count($page->testImg)){
		foreach($page->testImg as $image) {
			echo "<img src='{$image->url}'  alt='{$image->description}'  />";
			echo $image->description;
		} 
	}
?>

This is the output:

<img src='/old/site/assets/files/1122/02.gif' alt='' /><img src='/old/site/assets/files/1122/03.gif' alt='' />

And the field in use, don't know if maybe Im not using the correct field for description, but it's the only one I see when clicking an image

field.PNG

Edit:

I thought that maybe it was because of the second language "Spanish" But I have deleted it, set to language default and still having the same result.

Share this post


Link to post
Share on other sites

Well it seems after I've deleted spanish language, the field is unable to save its description field in the page.

Already tried to:

- delete images, re-add them, write descriptions, save.. Didn't save the descriptions field

- delete field from template, delete field from PW, re-create field, add to template, add images with descriptions.. Didn't save the descriptions field

Don't know what have I broke or how to fix it.. Do I need to reinstall PW?

Share this post


Link to post
Share on other sites

Hey, @alanxptm!

I am just guessing, but maybe you got your description filled only in one language, but output the value of some other (probably default) language. And it is blank.

  • Like 1

Share this post


Link to post
Share on other sites
4 minutes ago, Ivan Gretsky said:

Hey, @alanxptm!

I am just guessing, but maybe you got your description filled only in one language, but output the value of some other (probably default) language. And it is blank.

You're right. I was thinking on that too, but got confused because there isn't a description field for each language and the single one didn't save its text.

I have checked the box for "disable multilanguage descriptions" at edit field->input and now is working fine.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...