Hi.

I've got a simple little view - show all nodes of type X in a row - displaying the node title and body. One of the nodes, I put <!--break--> into the body to set where the teaser would end, and the view is displaying it in the text. I'm looking around, but I don't see a setting to control if that's displayed - I'd imagine it wouldn't want to be shown.

Help?

CommentFileSizeAuthor
#16 views-6.x-node_break.patch505 bytesAlexisWilke
#6 breakissue.jpg32.62 KBshawngo

Comments

merlinofchaos’s picture

Hm. It's possible the Node: Body field needs to filter the break out specifically, since it's handled specially.

geerlingguy’s picture

I'm having this same problem - where would I add a filter to take out the

text in the Node: Body field?

guygg’s picture

Yeah, same issue. I'm just using the Node->Body filed in a panel view and am using the Body field as the only field in the particular view, and it shows the break tag. Would be nice to keep it from showing that.

dawehner’s picture

can you exposed the view?

osimax’s picture

I have the same problem.
I am using Page View and Row Style = Fields.
Moreover I have some additional thoughts about combination which produces such behavior:
I have WYSIWYG Api with TineMCE installed. When <!--break--> is inserted in Full HTML Mode through TinyMCE button - it is always enclosed inside <p> .... </p> tags - this causes <!--break--> be outputted in a view field Node->body as &lt;--break--> . At the same time if using Row Style = Node text displays correctly.

If I use Filtered HTML without TinyMCE and simply place <!--break--> in node text - it's displayed correctly in both cases ( Row Style = Fields and Row Style = Fields ) without any problems.

dereine:
how can I expose view if it's still needed? If I make export view and post there - is it enough?

shawngo’s picture

StatusFileSize
new32.62 KB

I solved this issue by going into my Input Filter settings and disabling the HTML corrector Filter.

1. go to admin/settings/filters/list and click 'configure' next to the Input format in question
2. in the Filters fieldset, un-check HTML corrector
3. save configuration

The HTML corrector 'Corrects faulty and chopped off HTML in postings'. So, if you're relying on this setting to close tags within the teaser then this may not be the best solution.
A scenario might be - you split your node body inside an H1 tag (it's a bad practice, but a good example) - you are using the teaser in a block view. The H1 will not get closed and may wreak havoc on the remaining content in the site.

It should work fine if your teaser consists of HTML tags that are closed:

<p>My teaser text</p>

Shawn

guygg’s picture

Yup, shawngo's answer worked for me. Thanks.

avpaderno’s picture

Title: Node body not handling <!--break--> properly? » Node body does not handle <!--break--> properly
geerlingguy’s picture

#6/shawngo's answer fixed it for me as well... I'm still a little unsure about all the different input format settings... people say I shouldn't set the default to full html... however, if I don't, then the user must explicitly set full HTML every single time he/she makes a new post using a WYSIWYG tool.

merlinofchaos’s picture

I believe the answer would be to patch views_handler_field_markup to automatically remove <!--break--> prior to running it through markup. That will at least make sure it's not visible.

gpk’s picture

This looks like a manifestation of #222926: HTML Corrector filter escapes HTML comments.

EvanDonovan’s picture

If this is due to #222926: HTML Corrector filter escapes HTML comments, should we move it to the Drupal filter.module issue queue? I can confirm that the patch in #222926-66: HTML Corrector filter escapes HTML comments fixes this issue for me in regular teaser views, although I haven't tested it on views created by the Views module.

gpk’s picture

Yes that patch needs to be tested on Views module views. If it fixes the problem reported here then this issue can be marked duplicate of the other.

Another way to check if we have the same issue is to turn off the htmlcorrector filter from the relevant input format(s). Actually #6 confirms that that is the case.

However arguably <!--break--> *should* be stripped from the node body anyway (like node.module does), thereby removing it from the page source.

miiimooo’s picture

subscribe (can confirm that disabling htmcorrector is a workaround)

TBarregren’s picture

Just for information: I have made a D6 module that can be used to overcome this problem. See http://drupal.org/project/htmlcomment.

AlexisWilke’s picture

Status: Active » Needs review
StatusFileSize
new505 bytes

Thank you to merlinofchaos (#10) and gpk (#13) for the solution.

There is the patch.

Thank you.
Alexis Wilke

P.S. Remove the HTML corrector at your own risk!

P.P.S. use http://drupal.org/project/htmlcomment only if you know what you're doing! The reason why the core prevents comments is because they are dangerous. Hackers can use them to enter bad code in your site.

ppatriotis’s picture

This is also an issue with the RSS display. I'm not sure if the patch fixes that.

AlexisWilke’s picture

ppatriotis,

Can you test and let us know?

Thank you!
Alexis

joshmiller’s picture

Status: Needs review » Closed (duplicate)