replace spaces with underscores

Author Message

nigel dodd

Friday 06 January 2006 7:59:02 am

Surely there is an easy way, using a template function or operator, to replace the spaces in a string with underscores. It is done in the url for a page so surely the functionality to do it should be readily available to template code.

I have looked in the string operator documentation but there_is_nothing.

Felix Laate

Friday 06 January 2006 8:03:29 am

Hi Nigel!

I did this with the str_replace contrib (http://ez.no/community/contribs/template_plugins/string_replace_operator). Easy and efficiant.

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

nigel dodd

Friday 06 January 2006 8:45:34 am

Felicitudes to you Felix, you are correct. Many thanks.
Nigel

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 31 2025 03:33:16
Script start
Timing: Jan 31 2025 03:33:16
Module start 'layout'
Timing: Jan 31 2025 03:33:16
Module start 'content'
Timing: Jan 31 2025 03:33:17
Module end 'content'
Timing: Jan 31 2025 03:33:17
Script end

Main resources:

Total runtime0.9650 sec
Peak memory usage8,192.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 588.1328151.2109
Module start 'layout' 0.00460.0037 739.3438220.7031
Module start 'content' 0.00820.9558 960.04694,441.5078
Module end 'content' 0.96410.0009 5,401.554711.8516
Script end 0.9649  5,413.4063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3554160.0002
Check MTime0.00130.1332160.0001
Mysql Total
Database connection0.00060.061610.0006
Mysqli_queries0.888092.0259570.0156
Looping result0.00040.0382550.0000
Template Total0.918595.220.4592
Template load0.00180.187820.0009
Template processing0.916694.991720.4583
Template load and register function0.00120.124810.0012
states
state_id_array0.00170.177310.0017
state_identifier_array0.00130.138720.0007
Override
Cache load0.00150.1551150.0001
Sytem overhead
Fetch class attribute can translate value0.00140.143520.0007
Fetch class attribute name0.00200.211950.0004
XML
Image XML parsing0.00290.298820.0014
class_abstraction
Instantiating content class attribute0.00000.001260.0000
General
dbfile0.00490.5032220.0002
String conversion0.00000.001140.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
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs