Forums / Developer / New line character problem.

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

eZ debug

Timing: Jan 31 2025 01:17:08
Script start
Timing: Jan 31 2025 01:17:08
Module start 'content'
Timing: Jan 31 2025 01:17:08
Module end 'content'
Timing: Jan 31 2025 01:17:08
Script end

Main resources:

Total runtime0.2314 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0088 587.9297370.2969
Module start 'content' 0.00880.0150 958.22661,005.6406
Module end 'content' 0.02380.2076 1,963.86723,893.9375
Script end 0.2313  5,857.8047 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00512.1992200.0003
Check MTime0.00150.6428200.0001
Mysql Total
Database connection0.00120.498210.0012
Mysqli_queries0.119851.76361410.0008
Looping result0.00190.81331390.0000
Template Total0.207089.510.2070
Template load0.00100.417810.0010
Template processing0.206189.035310.2061
Override
Cache load0.00070.290010.0007
Sytem overhead
Fetch class attribute can translate value0.00210.924310.0021
XML
Image XML parsing0.00030.114510.0003
General
dbfile0.01315.6680200.0007
String conversion0.00000.002830.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.0001 secs