New Line in plain text emails

Author Message

Andreas Adelsberger

Thursday 29 May 2008 2:54:38 am

hi,

i want to achieve a format like this:

Your Order:

Item 1
Item 2
Item 3
--------------------------------------------
Sum

but with this code:

{"Deine Bestellung"|i18n("design/standard/shop")|upcase()}

{section name=ProductItem loop=$order.product_items show=$order.product_items sequence=array(bglight,bgdark)}

{$ProductItem:item.object_name} 

{/section}

...I get

Item 1

Item 2

What are the parsing rules here? Any hints?

---------------------------------------
Styleflasher New Media OG
Websites. Games/Multimedia.

Maxime Thomas

Sunday 01 June 2008 11:46:19 pm

Hi,

I'm surprised by the way you are doing templates files.
There's a new template which depreciates the section structure.
More here :

http://ez.no/doc/ez_publish/technical_manual/4_0/reference/template_control_structures/deprecated/section
http://ez.no/doc/ez_publish/technical_manual/4_0/reference/template_control_structures/looping/foreach

If you want to show what is in an object or an array, use that :

http://ez.no/doc/ez_publish/technical_manual/4_0/reference/template_operators/miscellaneous/attribute

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Andreas Adelsberger

Monday 02 June 2008 12:05:02 am

hi, thanx for your reply. normally i don't use sections in new templates. I just modified an existing template.

I just have problems with the new lines. I will try to change the whole thing to a foreach loop.

The problem is that i get either no new line or two new lines using this section loop.

this code gives me no new line:

{section name=ProductItem loop=$order.product_items show=$order.product_items sequence=array(bglight,bgdark)}
{$ProductItem:item.object_name} 
{/section}

this code gives me two new lines:

{section name=ProductItem loop=$order.product_items show=$order.product_items sequence=array(bglight,bgdark)}

{$ProductItem:item.object_name} 
{/section}

...but I just need one new line like:
Item1
Item2

---------------------------------------
Styleflasher New Media OG
Websites. Games/Multimedia.

Bruce Morrison

Monday 02 June 2008 1:31:54 am

Hi Andreas

There is only one option left :)

{section name=ProductItem loop=$order.product_items show=$order.product_items sequence=array(bglight,bgdark)}
{$ProductItem:item.object_name} 

{/section}

I've had success with this method in the past.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Andreas Adelsberger

Monday 02 June 2008 1:43:03 am

...hmmm, I think I already tried this version. I will check that again and set the post to SOLVED if it worked.

thanx for your help!

---------------------------------------
Styleflasher New Media OG
Websites. Games/Multimedia.

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 19 2025 00:09:52
Script start
Timing: Jan 19 2025 00:09:52
Module start 'layout'
Timing: Jan 19 2025 00:09:52
Module start 'content'
Timing: Jan 19 2025 00:09:53
Module end 'content'
Timing: Jan 19 2025 00:09:53
Script end

Main resources:

Total runtime1.2296 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 589.0391152.6250
Module start 'layout' 0.00530.0024 741.664139.4453
Module start 'content' 0.00771.2203 781.1094624.2813
Module end 'content' 1.22800.0015 1,405.390616.1641
Script end 1.2295  1,421.5547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2553160.0002
Check MTime0.00120.1007160.0001
Mysql Total
Database connection0.00080.065010.0008
Mysqli_queries1.155493.9654650.0178
Looping result0.00080.0623630.0000
Template Total1.200297.620.6001
Template load0.00190.152520.0009
Template processing1.198397.454320.5991
Template load and register function0.00010.007710.0001
states
state_id_array0.00150.118510.0015
state_identifier_array0.00190.154320.0009
Override
Cache load0.00160.1329520.0000
Sytem overhead
Fetch class attribute can translate value0.00070.055130.0002
Fetch class attribute name0.00130.108980.0002
XML
Image XML parsing0.00410.332630.0014
class_abstraction
Instantiating content class attribute0.00000.0017100.0000
General
dbfile0.00350.2880280.0001
String conversion0.00000.000440.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
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/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: 34
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs