Clean $content

Author Message

Olivier Hirt

Thursday 06 November 2008 8:02:21 am

Hi,

My template for customtag "mycustomtag" is :

<h2 class="toggle">{$content}</h2>

So the output is :

<h2 class="toggle"><p>lorem ipsum ...</p></h2>

I don't want this paragraph. I want :

<h2 class="toggle">lorem ipsum ...</h2>

Somebody can help me ?

Thanks.

Regards.
Olivier

kracker (the)

Thursday 06 November 2008 1:48:26 pm

I wrote a custom kernel hack to solve this problem once a very long time ago upon one of my regular returns to eZ Publish 3.4

It was ugly but it worked. In the end if memory serves me ... YRMV

Short answer: No

Long answer: Yes, but only for custom tag rendering (display) through a kernel hack of the part of the kernel which returns the '<p>' $customTagValue '</p>' which you want to alter.

Or ... I'm hoping in replying with my experience that another with a simpler answer will speak up as I do not know off hand a simple answer to this question.

Cheers,
//kracker

<i>Audio : YT Cracker : GraveDigger</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Łukasz Serwatka

Thursday 06 November 2008 11:19:35 pm

You can use strip_tags PHP function in tpl if you need raw text only
<h2 class="toggle">{$content|striptags()}</h2>

See template.ini.[PHP].PHPOperatorList

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Olivier Hirt

Friday 07 November 2008 12:10:45 am

Thanks a lot.
Just, it's not striptags but strip_tags
So : {$content|strip_tags()} it's ok

Thanks.

Regards.
Olivier

Łukasz Serwatka

Friday 07 November 2008 12:57:27 am

Just, it's not striptags but strip_tags

Actually it can be striptags too, it depends how you define in the configuration array ;)

Good to see that it works for you ;)

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.