converting XML Block to Text Block

Author Message

André R.

Tuesday 16 May 2006 5:54:00 am

How do I convert xml blocs to text block?

Like if I wanted to convert the article into to plain text..

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Felix Laate

Tuesday 16 May 2006 6:06:32 am

Hi André!

You could use <i>strip_tags</i>. But you need to set it up first in the [php]-block of template.ini:

[PHP]
PHPOperatorList[striptags]=strip_tags

Then use it in templates like this:

{$node.data_map._ATTRIBUTE_NAME_.content.output.output_text|striptags()}

Hope this will help you!

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Xavier Dutoit

Tuesday 16 May 2006 6:36:09 am

Hi,

You are obvioulsy going to loose the new lines (as it strips <p> tags too). I haven't find a better solution, but if you find something, please share.

X+

http://www.sydesy.com

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

eZ debug

Timing: Jan 18 2025 20:56:37
Script start
Timing: Jan 18 2025 20:56:37
Module start 'layout'
Timing: Jan 18 2025 20:56:37
Module start 'content'
Timing: Jan 18 2025 20:56:38
Module end 'content'
Timing: Jan 18 2025 20:56:38
Script end

Main resources:

Total runtime0.9498 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.9141152.6250
Module start 'layout' 0.00540.0032 740.539139.4453
Module start 'content' 0.00870.9396 779.9844580.6563
Module end 'content' 0.94820.0016 1,360.640612.1563
Script end 0.9498  1,372.7969 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3630160.0002
Check MTime0.00140.1434160.0001
Mysql Total
Database connection0.00100.101010.0010
Mysqli_queries0.893894.0982590.0151
Looping result0.00070.0723570.0000
Template Total0.919096.820.4595
Template load0.00220.231520.0011
Template processing0.916896.525520.4584
Template load and register function0.00010.010610.0001
states
state_id_array0.00100.105310.0010
state_identifier_array0.00110.115620.0005
Override
Cache load0.00180.1900200.0001
Sytem overhead
Fetch class attribute can translate value0.00130.137830.0004
Fetch class attribute name0.00200.210060.0003
XML
Image XML parsing0.00140.149530.0005
class_abstraction
Instantiating content class attribute0.00000.001360.0000
General
dbfile0.00100.1074290.0000
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs