Forums / Developer / New line character problem.
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
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
Does this look like a good solution to you?
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()}