I have a Views block on the home page of my site (http://directionpersonaltraining.com/) that I am using to display a "Blog Post Preview". I am using the "Trim this field to a maximum length" feature in Views on the body of the post. In the Views preview all works well. When I look at it on the homepage the title and comment count are display but the body field is left blank. There is mark-up for it in the HTML but no text is output. I thought this might be a Views issue but when I switch the site to Bartik or Stark, the trimmed text from the body field is there leading me to believe it is an Omega issue.
I found a couple issues in the Views queue that may be related:
http://drupal.org/node/954238
http://drupal.org/node/1014486
Really looking forward to using this theme.
Comment | File | Size | Author |
---|---|---|---|
#8 | views_strip_html_tags_bartik.png | 398.02 KB | 2ndmile |
#8 | views_strip_html_tags_omega.png | 252.65 KB | 2ndmile |
#5 | views_omega_trimmed_field.png | 110.06 KB | himerus |
Comments
Comment #1
2ndmile CreditAttribution: 2ndmile commentedI suppose I should add that I am using a sub-theme created from the starterkit in the Omega theme.
Comment #2
himerus CreditAttribution: himerus commentedI'm definitely puzzled why this would happen because of Omega... there is no real manipulation of views directly BY the Omega base theme...
It will take some digging to test this one out and narrow it down a bit. Any additional debugging you can provide will help!! But I'll see what I can do.
Comment #3
2ndmile CreditAttribution: 2ndmile commentedhimerus... let me know what I can do to help... I am willing to give you admin access on the site if that would help. I really want to try Omega since I have been using zen_ninesixty but it does not have a D7 version and Omega has a ton of cool features.
Comment #4
himerus CreditAttribution: himerus commentedI'm really thinking this has to be something in views rendering.... I just down see how/where Omega could be doing ANYthing that would affect this data.
I will continue to look, but I think one of those issues you linked had the most relevant data, that the trimmed setting now was almost useless with the field output settings for fields in content types. I need to read a bit more to fully understand how this has changed the way views renders trimmed text.
Is your trimmed text in a views display with field values or as a node display??
Comment #5
himerus CreditAttribution: himerus commentedI'm marking this as "cannot reproduce".
The attached screenshot shows my own view of nodes with title (node) and body (field) fields, and I've set the body field to trim to a max length of 255 chars.
This is working as expected in my own installation with the starterkit.
Please make sure your views, ctools to the latest versions.
Again, my confusion on this issue is that there is nothing Omega does that modifies field content from views. The only custom views code in Omega is a slight modification to the pager and mini pager theme functions. nothing more.
Comment #6
2ndmile CreditAttribution: 2ndmile commentedThanks for taking the time on this.
Try checking the "Strip HTML tags" checkbox. Without that checked everything shows as expected. But again.. this problem only happens when Omega is used.
To answer your questions, my views display is using field values. Views and cTools are latest versions.
Comment #7
himerus CreditAttribution: himerus commentedI did have strip html both checked and not, and got at least some stuff back... the issue sure was seeming to be in the other views issues where html wasn't escaped, and then did something wonky in the source code...
I'm just not sure... especially why this would seemingly only happen in Omega.
I'm using views on a LOT of D7 projects right now, and haven't had this issue (even in one large project with dozens of views field displays with trimmed fields)
Comment #8
2ndmile CreditAttribution: 2ndmile commentedTruly strange... attached two screen shots. First shows results in bartik. Second results in omega subtheme. The only difference between the two is changing the theme.
Comment #9
himerus CreditAttribution: himerus commentedMarking this back as active....
Can you paste the export of your view for me to test with?
Comment #10
2ndmile CreditAttribution: 2ndmile commentedAgain, I can give you admin access to this site if you think that would help.
Comment #11
abbasmousavi CreditAttribution: abbasmousavi commentedI have the same problem but there is a more strange point. On my dev server there is no problem but when I copy the code and database on my production server trimmed fields are empty. there is the html tag for the field but it is empry. I have tested trim text .. and also field formatter and the problem only exist with Omega.
I am confused.
Comment #12
abbasmousavi CreditAttribution: abbasmousavi commentedselecting "summary or trimmed" formatter solved the problem if you don't select "strip HTML tags"!
Comment #13
2ndmile CreditAttribution: 2ndmile commentedI noticed that as well during my troubleshooting. I am using this as a Blog Post Preview that fits into the template is a very specific way so i would like to strip and the like. I suppose I could "display:none".
On the other hand, it is probably good to squash this bug.
Comment #14
micheHi Everyone,
I have encountered the same issue.
My setup:
standard install profile
no additional themes added
Views, CTools, Devel as the only contrib modules
What didn't work:
1. Body field, trim field to a maximum length, 100 characters, trim only on a word boundary, add an ellipsis, formatter = Default.
What DID work:
1. Body field, trim field to a maximum length, 200 characters, trim only on a word boundary, add an ellipsis, formatter = Default.
2. Body field, formatter = Summary or Trimmed, 200 characters
Because Omega was not downloaded into this site, I am marking this issue as closed. I am still looking to see if there already is an issue open in Views or elsewhere. Clearly there is an issue with the trimming before it is passed to the theme layer.
Comment #15
cooldeeponline CreditAttribution: cooldeeponline commentedI tried these settings and it worked:
Maximum length: 8 (it cant be any value as per your requirement)
1. Uncheck "Trim only on a word boundary"
2. Check the following options:
i) Add an ellipsis
ii) Field can contain HTML
iii) Strip HTML tags
N.B.If you would like to strip the userame:
i) Check Output this field as a link
ii) In the Link path: set it as [name]
Comment #16
escoles CreditAttribution: escoles commentedChanging title back as "solved!" is not informational in the context of an issues listing. (i.e., good to be able to see what problems the solutions are for without having to open the issue.)
Comment #17
osopolar[deleted wrong post]