Replace a string

Author Message

Ted Striker

Wednesday 28 February 2007 4:40:21 am

Hi,

I'm trying to dynamically replace and output to template an existing text, let's say:

"CompanyName" in {$node.object.data_map.intro.content.output.output_text}

by another text like

<strong><font color="#FF0000">Company</font><font color="#666666">Name</font></strong>

is it possible?

does eZpublish have any function like "str_replace" in php??

Thank you in advance!

Can you feel it Mr. Anderson? Closing in on you? Oh I can, I really should thank you after all. It was, after all, it was your life that taught me the purpose of all life. Purpose of life is to end.

Brookins Consulting

Wednesday 28 February 2007 6:03:28 am

Use the wrap_operator, http://ezpedia.org/wiki/en/ez/wrap_operator

eZ Partner | North American Experience
http://brookinsconsulting.com/experience

Kristof Coomans

Wednesday 28 February 2007 6:55:12 am

Or http://ez.no/community/contribs/template_plugins/string_replace_operator

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Ted Striker

Thursday 14 June 2007 1:34:17 am

Ups!! forgot to reply

ezstr_replace extension works fine... I reccommend using this simple but useful extension...

thanks to all!!!

Can you feel it Mr. Anderson? Closing in on you? Oh I can, I really should thank you after all. It was, after all, it was your life that taught me the purpose of all life. Purpose of life is to end.

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 30 2025 01:04:00
Script start
Timing: Jan 30 2025 01:04:00
Module start 'layout'
Timing: Jan 30 2025 01:04:00
Module start 'content'
Timing: Jan 30 2025 01:04:00
Module end 'content'
Timing: Jan 30 2025 01:04:00
Script end

Main resources:

Total runtime0.0113 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0039 588.0313151.1953
Module start 'layout' 0.00390.0021 739.226636.6172
Module start 'content' 0.00610.0041 775.843894.0313
Module end 'content' 0.01020.0011 869.875033.9922
Script end 0.0113  903.8672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.001815.9135140.0001
Check MTime0.00097.9852140.0001
Mysql Total
Database connection0.00065.751110.0006
Mysqli_queries0.002118.890330.0007
Looping result0.00000.088610.0000
Template Total0.00087.410.0008
Template load0.00065.318610.0006
Template processing0.00022.008410.0002
Override
Cache load0.00043.673010.0004
General
dbfile0.00119.360880.0001
String conversion0.00000.052740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

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

Time used to render debug report: 0.0001 secs