How to use the MT:EntryBody tag with additional modifiers for removing content

131 Views Asked by At

I'm trying to remove text (with a specific class) from MT:EntryBody. More specifically, I'm trying to remove headers from my summary pages.

On this page, http://www.taconic.com/taconic-insights/microbiome-and-germ-free/, in the middle of the first entry there is text that says "Defining Rodent Health Standards". This makes no sense in the summary (because I'm stripping HTML - obviously). SO I want to just remove this line from the summary. I tried using a tag as well as a CSS hidden class but I can't get this to work properly.

Thoughts?

2

There are 2 best solutions below

2
François Nonnenmacher On BEST ANSWER

To clarify, you want to remove this in the entry body?

<h3 class="hidden">Defining Rodent Health Standards</h3>

Then, before stripping HTML, you need to use a regexp to catch and remove those blocs. Then, you can remove HTML.

See https://movabletype.org/documentation/appendices/modifiers/regex-replace.html

0
Mihai Bocsaru On

The easiest thing you could do is to replace:

<$mt:EntryBody$>

With:

<$mt:EntryBody replace="Defining Rodent Health Standards",""$>

Glad to answer also other questions that you might have!