Layout of email send by information collector

Author Message

Marko Pohl

Tuesday 24 February 2004 3:54:20 am

Hi!
I am trying to format the email send by the information collector.
My aim is to have all fields in a custom order and layout.

I have started with overriding the template 'content/collectedinfomail/form.tpl' but I dont know how to access the submitted values by name.
All I found was the array $collection.attributes, but its indexed by numbers.

Thanks for any hints!

Paul Forsyth

Tuesday 24 February 2004 7:05:31 am

As the colleciton is a template like others you can use debugging like this:

{$collection.attributes|attribute(show)}

Your results should be in the email :)

From this you will be able to see the names of each attribute and code accordingly.

paul

Marko Pohl

Wednesday 25 February 2004 2:33:49 am

hi!

Maybe I explained myself not clear engough...
My problem is to access this array ($collection) by the attribute name.
The structure getting from |attribute(show) is an number indexed array:
>...
> data_text string 'tralla'
> contentclass_attribute_name string 'name'
>...
1
>...
> data_text string 'trallafdsds'
> contentclass_attribute_name string 'messege'
>...
...

In my temlate code I would like to access the fields this way:
{section show=$collection.attributes.message}
Message:
-----------------
{$collection.attributes.message.data_text|wash}
{/section}

Is this possible somehow?
Or, what is the template code to construct an string indexed array from the collection array?

Thanks for your answers,
Marko

Paul Forsyth

Wednesday 25 February 2004 4:57:16 am

You can access array elements just as you would with other programming languages. For example:

Show the name
{$collection.attributes[0].data_text|wash(xhtml)}

Show the message
{$collection.attributes[1].data_text|wash(xhtml)}

If you wanted to make it a little cleaner you could assign variables:

{let message=$collection.attributes[1]}
{$message.data_text|wash(xhtml)}
{/let}

The only problem with this is you must know what the index of the array refers to, which the attribute(show) has revealed.

Paul

Marko Pohl

Wednesday 25 February 2004 5:34:13 am

Hi!
First thanks for your replies!

>The only problem with this is you must know what the index of the array
>refers to, which the attribute(show) has revealed.

That is exactly my problem.
If you use checkboxes in a form they will only result in an new array item if they were checked. (Please correct me if I am wrong)
Otherwise the array will be shifted and all indexes after the checkbox will change.

My conclusion for now is to place all checkboxes at the end of the form class to keep the other indexes reliable. Not really nice...

Do you know how it is possible to construct an new array containing the 'data_text' values indexed by the 'contentclass_attribute_name' from '$collection'?

In future I will use


    

tags, looks cool :)

Marko

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 31 2025 01:15:04
Script start
Timing: Jan 31 2025 01:15:04
Module start 'layout'
Timing: Jan 31 2025 01:15:04
Module start 'content'
Timing: Jan 31 2025 01:15:05
Module end 'content'
Timing: Jan 31 2025 01:15:05
Script end

Main resources:

Total runtime0.7451 sec
Peak memory usage8,192.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 588.2656151.2266
Module start 'layout' 0.00620.0040 739.4922220.7188
Module start 'content' 0.01020.7340 960.21094,245.8828
Module end 'content' 0.74420.0009 5,206.093811.8125
Script end 0.7451  5,217.9063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.5373160.0003
Check MTime0.00140.1824160.0001
Mysql Total
Database connection0.00080.108310.0008
Mysqli_queries0.646386.7309630.0103
Looping result0.00070.0886610.0000
Template Total0.690892.720.3454
Template load0.00190.257420.0010
Template processing0.688992.447320.3444
Template load and register function0.00160.212710.0016
states
state_id_array0.00110.150410.0011
state_identifier_array0.00060.079220.0003
Override
Cache load0.00170.2277610.0000
Sytem overhead
Fetch class attribute can translate value0.00170.228620.0009
Fetch class attribute name0.00290.391450.0006
XML
Image XML parsing0.00020.030220.0001
class_abstraction
Instantiating content class attribute0.00000.001950.0000
General
dbfile0.00310.4127100.0003
String conversion0.00000.001240.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
15content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/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: 6

Time used to render debug report: 0.0001 secs