Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Generating carriage return/line feeds in Word documents

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
dhodgman1
Smarty n00b


Joined: 02 Jun 2021
Posts: 1

PostPosted: Wed Jun 02, 2021 7:06 am    Post subject: Generating carriage return/line feeds in Word documents Reply with quote

Hi all (my first Smarty post),

I'm using Smarty as part of the Flexidocs document generation tool and am very frustrated that I can't seem to convert line feeds in a text field, as they are stored in a database, into a carriage return/line feed that will show up in the Word document that is being generated. Any line feeds that my users enter in our system disappear and a long, concatenated string is rendered.

I've tried regex_replace with many combinations of replacement characters, none of which are honoured when the document is generated.

e.g.
Code:
{$groupProducts.description|regex_replace:'/[\n]/':"$crlf"}

where I've tried setting $crlf to various combinations of characters.

BTW, in this set up, I don't have the option of working in straight PHP before the data is delivered to Smarty.

Would greatly appreciate any help.

Dave

P.S. I believe we're using Smarty 3
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Sat Jun 05, 2021 11:04 pm    Post subject: Reply with quote

Add
Code:
{$smarty.version}
somewhere in your template to be sure.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP