Reputation: 614
I want to output full node body code in Views, but HTML tags get automatically stripped. The problem is that "Strip HTML tags" check box isn't checked.
So, instead of e.g.:
<p>Example</p>
I get:
Example
Edit: I see that I didn't explain my problem well. What I want to get aren't e. g. 5 paragraphs. I want to get the code displayed. E. g.:
<p>Paragraph1</p>
<p>Paragraph2</p>
<p>Paragraph3</p>
Instead of:
Paragraph1
Paragraph2
Paragraph3
The purpose is to export the code to import these nodes in another installation.
Upvotes: 0
Views: 7901
Reputation: 614
If you want to get the output with HTML tags, you can do two things:
Build a normal view and then copy/paste the HTML code from View source option or from Firebug
Use the patch for Views data export module posted here: http://drupal.org/node/1224894. That way you can export fields with HTML tags included.
Upvotes: 0
Reputation: 857
You probably have the text format of the node's body field set to strip <p>
tags before the content even gets into Views. Edit one of the affected nodes, make sure that the text format is not set to "Plain text", and make sure that <p>
is in the list of "Allowed HTML tags".
(For Drupal7) If it isn't in the list, go to Home » Administration » Configuration » Content authoring and click on Text Formats (/admin/config/content/formats). Click "configure" for the text format you want to change. Add <p>
to the list of "Allowed HTML tags" in the "Filter settings". Or you could set up a new text format that doesn't limit the allowed HTML tags.
(For Drupal6) Go to /admin/settings/filters, click "configure" for the text format you want to change then click its "Configure" tab.
If you want to display the body field's HTML, the HTML needs to be "escaped" so that the browser doesn't render it. The only way I know to do this would be to set the text format of each node to "Plain text" and then change your Views Field Formatter to "Default".
Upvotes: 1