I've searched and found similar issues but not quite this. I wasn't sure if this is a bug or a support request. Feel free to change it.
I have a content type that contains an imagefield. The image has an associated title (and description). I display the title in the node using this code:
print $item['data']['title'];
In the views, I'm choosing the field Content: Image - data and selecting the imagefield title.
If the title contains an apostrophe, or html code, it displays correctly on the node page but displays as html entities (I think that is the correct term) in the view:
' or <
There is no option to use html formatting for the field as far as I can tell.
It doesn't seem like a CCK bug since it is displaying correctly in the node. Am I doing something wrong or is this a views bug? I hope I didn't just miss a setting somewhere.
The view is attached.
Thanks for taking the time to look at this.
| Comment | File | Size | Author |
|---|---|---|---|
| view.txt | 35.11 KB | ron collins |
Comments
Comment #1
merlinofchaos commentedImage Field is responsible for the display of its own data. This looks like maybe there's a double check_plain() somewhere.
Comment #2
quicksketchThanks for the report. ImageField is indeed the correct place for this issue. I assume you're using the latest 3.9 version, correct?
Comment #3
ron collins commented3.9. Yes.
Comment #4
ron collins commentedchanging version.
Comment #5
Anonymous (not verified) commentedSubscribing.
Comment #6
Anonymous (not verified) commentedMy workaround. Overwrite the output with a template file (views-view-field.tpl.php). This works for me:
Comment #7
Anonymous (not verified) commentedI've also just come across this. I can confirm that apostrophes in my title text are being displayed as
'in my view, but not in the node itself.This leads me to think it's an issue with the Views implementation, but since this module doesn't have any Views code, I think it might be in the Filefield module...
Comment #8
jaarong commentedAny updates on this? I just discovered this issue on my site. It must have come from a recent update, because I don't think this has always been happening.
Comment #9
pomliane commentedSame issue with ImageField descriptions provided by ImageField Tokens and unable to clearly find the responsible module so... subscribing here too.
The problem appears both in Views and in node view with this particular description field.
Comment #10
dunx commentedChecking "Enable custom title text" under "Title text settings", I can enter "Picture © Me" as the title of an uploaded image, but this is displayed as "Picture © Me" on the title tag on the full node, rather than "Picture © Me".
As an aside, I'm also using Lightbox2 and the copyright symbol displays as expected as the title underneath the image.
On the teaser, I have a cropped image linking to the full node. That too has "Picture © Me". Probably a separate issue, but can you override that title to be "Click for full item"? Is that themeing?
Comment #11
TimeBandit commentedThanks, #6 helped me. Use
print_r($row)to see the name of your field that should replace "node_data_field_image_field_image_data"Comment #13
ayalon commentedI have the same problem. I did it with a php custom field. Waiting for a real solutions. Can easily be reproduced. Just outbut the image description with an apostophe in a view.
Comment #14
amogiz commentedSubscribing.
Please could you tell me the "syntax" to write the title in a php custom field ?
I could not find.
Comment #15
stolzenhain commentedSubscribing. Also, because I had some trouble understanding the fix, here's how got it to work the least intrusive via views templates for this field only (replace MYFIELDNAME with the system name of your imagefield):
views-view-field--field-MYFIELDNAME-data.tpl.php<?php print $output; ?>with the code shown in #6:Comment #16
quicksketchThis has been fixed in FileField's views handling (thus fixing ImageField): #1018850: Views file data description shows encoded characters