htmlmovabletype

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


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?


Solution

  • 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