New line character problem.

Author Message

Dmytro Tomilovskiy

Wednesday 17 May 2006 6:59:11 am

Hi everyone.
I have a problem with this line of code:

var comicname ="{attribute_view_gui attribute=$node.object.data_map.label)";

For some reason it returns the following:

var comicname="\nBetween_Friends";

as apposed to:

var comicname="Between_Friends";

Any ideas why?

Thank you for your time.

Łukasz Serwatka

Wednesday 17 May 2006 10:53:04 am

Dmytro, hello and welcome to the eZ publish Community!

What datatype is label in your example?

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

Dmytro Tomilovskiy

Thursday 18 May 2006 8:00:12 am

Good day Lukasz.
In my example label is a Text Line, if that is what you mean.

I figured that this problem can be solved by editing

design/standard/templates/content/datatype/view/ezstring.tpl

Where I changed

{* DO NOT EDIT THIS FILE! Use an override template instead. *}
{$attribute.data_text|wash( xhtml )}

to

{* DO NOT EDIT THIS FILE! Use an override template instead. *}{$attribute.data_text|wash( xhtml )}

Does this look like a good solution to you?

Thank you for your time.

Łukasz Serwatka

Thursday 18 May 2006 11:39:53 am

It is not recommend to edit default eZ publish templates. Use override system instead.
Copy the original dir structure and file to your design directory:

(yourdesign)/standard/templates/content/datatype/view/ezstring.tpl

Then you can safely edit tpl file. Function attribute_view_gui uses template for rendering output from attribute.

In case where you need it in one place better use direct access to the attribute content:

This will return value from attribute (without new line, no tpl changes required)

{$node.object.data_map.label.data_text|wash()}

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.

eZ debug

Timing: Jan 18 2025 19:03:07
Script start
Timing: Jan 18 2025 19:03:07
Module start 'layout'
Timing: Jan 18 2025 19:03:07
Module start 'content'
Timing: Jan 18 2025 19:03:08
Module end 'content'
Timing: Jan 18 2025 19:03:08
Script end

Main resources:

Total runtime1.2365 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0083 589.0469152.6250
Module start 'layout' 0.00830.0052 741.671939.4453
Module start 'content' 0.01351.2199 781.1172551.8906
Module end 'content' 1.23340.0030 1,333.007812.1641
Script end 1.2365  1,345.1719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2773160.0002
Check MTime0.00150.1205160.0001
Mysql Total
Database connection0.00310.251310.0031
Mysqli_queries1.160093.8128600.0193
Looping result0.00130.1084580.0000
Template Total1.184195.820.5921
Template load0.00200.159320.0010
Template processing1.182195.604420.5911
Template load and register function0.00020.019310.0002
states
state_id_array0.00170.140110.0017
state_identifier_array0.00210.169820.0010
Override
Cache load0.00170.1391370.0000
Sytem overhead
Fetch class attribute can translate value0.00100.080320.0005
Fetch class attribute name0.00250.203150.0005
XML
Image XML parsing0.00100.083220.0005
class_abstraction
Instantiating content class attribute0.00000.001560.0000
General
dbfile0.00320.2597180.0002
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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/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: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs