Why is Ellipsis taking heading tag?

When I use ellipsis [[+content:ellipsis=200]] for content, It takes heading(h1, h2, h3 and so on) and paragraph tags. But I need only a paragraph tag. Is this possible to do?

I don’t exactly understand what you are trying to do.

The ellipsis output modifier just takes the text you supply (content in your case) and cuts it at the specified point (200 in your case). If the heading is part of the content, then the heading is part of the result.

If the ellipsis output modifier doesn’t do want you want, you can always write a custom output modifier. A custom output modifier is just a snippet.

As a reference, this is the code of the ellipsis output modifier.
It searches for the first space character after the specified breakpoint (mb_strpos), truncates the string (mb_substr) and then closes open HTML tags.

If the problem is that the Content field contains HTML tags [which it often will] you could try using the striptags output modifier:


Thanks a ton. It’s working fine as I wanted.

1 Like