A patch to address 2 issues:

* Unless I missed something, the teaser would be displayed regardless of whether or not it had a value.
* Some WYSIWYG editors will leave some "content" behind even if the user has not entered a value. This was tested with FCKeditor

CommentFileSizeAuthor
#1 cck_teaser_field.564828.patch1.09 KBfp

Comments

fp’s picture

StatusFileSize
new1.09 KB
nedjo’s picture

Thanks for the patch!

I like the idea of testing for empty content, and using drupal_html_to_text() is clever.

I'm concerned thought that we could end up suppressing legitimate content. For example, what if the content was an embed element?

fp’s picture

Good point. I'll need to meditate a bit more on this, but at this time I see two approaches:

1) Finding out if we can suck up the "empty" field value for the different editors (via the wysiwyg module or not). This may not be easily feasible and/or sustainable;
2) Do some regexing to look for empty tags or tags that do not require text to output a value (such as the object tag) after which we could use something like drupal_html_to_text().

Maybe there are more interesting approaches?