Weird behaviors with teaser break code inserted by TinyMCE

Events happening in the community are now at Drupal community events on www.drupal.org.
chowdah's picture

I posted this in the forums but it was buried with no response, so I'm hoping to find some answers here.

I'm using Drupal 6.13, and have installed TinyMCE using the WYSIWIG module. Everything works great with the editor, but I'm confused about some issues I'm having with the teaser breaks:

  • I can insert a <!-- break -->using the teaser break plugin for tinymce with no problems in the output, but if I choose not to insert a teaser break in the node, one is automatically inserted. Is there a way to eliminate the auto-insertion of teaser break [teaserbreak]. Sometimes I want the whole post on the homepage regardless it's length.
    • the only way I can achieve this right now is to insert the teaser break at the end of the post in the editor. This shows the whole post on the front page, but it also forces rendering of the "Read More" link at the end of the post (which is kind of silly because there is nothing left to read)
  • if I use a teaser break in a node/post, and then use Views module to render a list of nodes the code <!-- break --> appears in the view output. Is there a simple solution to fixing this?

Sorry if this is a double post but for some reason when I search under the term <! -- break -->, the tags are filtered out and it affects the search results! Drupal is even filtering out the break code using the code tags in this post - hence the intentional misformatting of the break tag throughout this post.

Thanks for any help!

Comments

Increase the size of the teaser!

jcfiala's picture

You can't prevent it from doing a teaser break, but you can increase the size of the teaser, which by default is 600 characters. Just go to admin/content/node-settings (titled post settings) and set the 'Length of Trimmed Posts' to 'Unlimited'.

-john

doh!

chowdah's picture

Thanks for that - any advice on the breaks that show in the views output?

More info?

jcfiala's picture

I'm not sure what you mean by that, sorry.

-john

I'm talking about the second

chowdah's picture

I'm talking about the second bullet point in my original post

How the teaser break comment

twod's picture

How the teaser break comment is treated on the server is not controlled by Wysiwyg module. For it to show up in the final rendered content (as visible text) you must have some input filter or something enabled which converts it to HTML entities like &lt;!--break--&gt;.

That would most definitely be

chowdah's picture

That would most definitely be the case if it happened across all content, but it only happens in output generated by Views.

I have the same issue and it's not the teaser length..

timgilmour's picture

Having the same issue, WYSIWYG API 2.x-dev and TinyMCE 2.6.5, what it's doing is inserting a teaser break at the very beginning of the node, before all node content. It doesn't look like Drupal is doing it, since it's coming in on the node/edit screen, as a visible element. And if I go and edit the node after the break is inserted, it keeps inserting more, one on each edit, so eventually you end up with a bunch of teaser breaks wrapped in

<

p> tags.

And if you delete them, on submit they just start over again. Teaser trim length is set to 600 chars.

You should start by upgrading

chowdah's picture

You should start by upgrading tinyMCE to 3.2.7.

i seem to have mistyped.

timgilmour's picture

it's actually tinymce 3.2.5. and it does it in both tinymce and fckeditor, so it probably isn't the text editor.

Weird

chowdah's picture

Could this be a browser issue? What are you using?

nah not a browser issue

timgilmour's picture

occurs in all i'm looking at it in -- browsers (from IE6 - 8, Firefox 2 & 3, Safari 4, Chrome). it's an open atrium site though, probably has to do with that build specifically. there's actually an issue over there that i found late last night: https://community.openatrium.com/issues/node/530 which is exactly it. probably a conflict between WYSIWYG and one of their custom modules, so hey :)

I posted my response in the

chowdah's picture

I posted my response in the wrong spot sorry...

interim solution

MikeBC's picture

I have exactly the same problem--"{!--break--}" (with "<" and ">" not curly braces) appears in views of the content but not in the main "native" node view. I did a workaround in the theme layer with a template file for the view, in particular, the theme file for the particular field that contains the full node content, which in my case happened to be called:

views-view-field--single-event--page--body.tpl.php

(i would be happy to explain how i arrived at this file name but in short, look at the info that "Theme: Information" (in the edit view UI) pulls up and you can pick a filename from the list.

Anyway, in the template file,

paste:

<?php

$output
str_replace('<p>&lt;!--break--></p>', '', $output);

print
$output;

?>

this just takes the string that is displayed as the node content and looks for the "break" code, and replaces it with nothing.

then save it in your sites/all/themes/[themname] directory


edit: hah looks like this site has the same filter running because it stripped out "{!--break--}" in my first line above (which had < > not { })

anyway you get the drift.

The Culprit

justawayfarer's picture

Disable the Seed Module!

I had the same thing happening with the tag being inserted before any text. It didn't matter what the input set up was. Reading through the posts I see that it most likely occurred due to one of the custom modules from Open Atrium (since I also had that in common). So I simply disabled the Seed Module, and it took away the break insertion. Besides showing up in views it also kept me from having any teasers. If you need this module you will have to dig deeper into this modules code to see what it is doing. Since I was just experimenting with some of Development Seeds innovations I had no need of it. All it seems to do is "clean up" html for the way Open Atrium needs nodes to be displayed.

In views issue queue

dipen chaudhary's picture

After digging through views issue queue, I found this - http://drupal.org/node/348514 which is a duplicate of filter.module issue queue http://drupal.org/node/222926

This kind of fixes it for me - http://drupal.org/node/348514#comment-1464448 but I will be looking at proper cause and solution. And see issues in detail.


Dipen Chaudhary
Founder, QED42 http://www.qed42.com Drupal development

Wysiwyg

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week