0

I am using a view to create a block that display a set of data. The data appears as expected, but it shows HTML markup between body fields, which I want to strip or render as they are like in nodes. I am using hook_views_pre_render(), but I am not able to strip HTML markup with that.

How can I achieve this? Is there any view settings for removing HTML markup?

  • @kiablaluno thanks for editing the question but it will be really helpful if you can answer the question. Thanks – FAB Jan 3 '18 at 13:13
1

I was using Aggregation (Group Results Together) which caused body field to print the unrendered HTML which is fixed by checking the Format option in additional fields to true.

enter image description here

  • This answer may solved your issue but does not seem to answer the question. Maybe the question needs to be rephrased to not mislead other users? – LarS Feb 28 '18 at 21:50
0

Use the strip HTML tags option in rewrite results Use the strip HTML tags option in rewrite results

0

If you are using fields in the View, just click on the body field in the View configuration and check “Strip HTML tags”. I believe that’s the name of the option. You don’t need code for that.

  • It's not working i.e. I switched to do it using code. – FAB Jan 3 '18 at 12:39
  • "Strip HTML tags" would absolutely work, there must be some detail you are leaving out otherwise. – Kevin Jan 3 '18 at 15:20
  • Can you elaborate what do you mean by some detail ? – FAB Jan 4 '18 at 5:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.