Forums / Setup & design / Clean $content

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

eZ debug

Timing: Jan 31 2025 08:56:06
Script start
Timing: Jan 31 2025 08:56:06
Module start 'content'
Timing: Jan 31 2025 08:56:06
Module end 'content'
Timing: Jan 31 2025 08:56:06
Script end

Main resources:

Total runtime0.4824 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0099 587.8047180.8516
Module start 'content' 0.00990.0096 768.656397.9453
Module end 'content' 0.01950.4629 866.6016526.4766
Script end 0.4824  1,393.0781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.8812200.0002
Check MTime0.00140.2999200.0001
Mysql Total
Database connection0.00180.374310.0018
Mysqli_queries0.390380.90981410.0028
Looping result0.00190.39041390.0000
Template Total0.462595.910.4625
Template load0.00100.202910.0010
Template processing0.461595.652710.4615
Override
Cache load0.00060.132610.0006
Sytem overhead
Fetch class attribute can translate value0.00090.191310.0009
XML
Image XML parsing0.00030.056110.0003
General
dbfile0.03527.2897200.0018
String conversion0.00000.001430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs