I don't know about a suitable washing operator to do this, but if it doesn't exist yet then maybe we can create our own? As I see it, I would just traverse the dom tree and append all text nodes to each other.
Didn't know there was a strip_tags operator either. Is it documented somewhere?
@Kristof You can define it in template.ini.append.php
[PHP]
# A list with php functions and their equivelant template operator names
# Giving the operators a different name from the PHP functions
# are recommended, that way you ensure that all operators follow
# the same naming guidelines. It also means that you can change the
# php function later on without doing template changes.
PHPOperatorList[striptags]=strip_tags
Where value is name of PHP function.
@Xavier:
In many cases $content|wash is sufficient. Have you tried?
EDIT: On community home page links to last forum topics uses:
I use it to populate attributes with powercontent. Works great !
@Who wants to listen.
The strip_tag operator is really mandatory in quite a lot of cases, even if it is far to be perfect. For instance, you can't use the shorten operator without it on a xmltext (otherwise, you're going to have your text cut between two tags with quite funny result).
Still don't get why it isn't standard in ez. Who should we beg/bribe/beat with a stick so it's included in the default ?
Yes, you are right Xavier. Forum uses text filed so no tags in output by default (as long as user will include something), on ezxml filed you need to use striptags other way you will have xhtml tags in the output.
Is the wash|shorten(lenght) used as well in the content/new ?
In that case, I see the problem:
It truncates after the first paragraph (or so it seems),
As quite a few post start with, <p>Hi</p> or <p>@Someone</p> it doesn't give a very usefull title, even so that would be possible to put more chars and stay under lenght.
I think it was why I strip_taged the content first.