Forums / Developer / Layout of email send by information collector

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

eZ debug

Timing: Jan 18 2025 21:01:24
Script start
Timing: Jan 18 2025 21:01:24
Module start 'content'
Timing: Jan 18 2025 21:01:24
Module end 'content'
Timing: Jan 18 2025 21:01:24
Script end

Main resources:

Total runtime0.1641 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0091 588.9766180.8125
Module start 'content' 0.00910.0056 769.789197.9453
Module end 'content' 0.01480.1493 867.7344526.6250
Script end 0.1641  1,394.3594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00362.1898200.0002
Check MTime0.00130.8143200.0001
Mysql Total
Database connection0.00140.840810.0014
Mysqli_queries0.115570.34561410.0008
Looping result0.00130.81131390.0000
Template Total0.148990.710.1489
Template load0.00080.501410.0008
Template processing0.148190.218310.1481
Override
Cache load0.00060.370410.0006
Sytem overhead
Fetch class attribute can translate value0.00211.307510.0021
XML
Image XML parsing0.00030.159610.0003
General
dbfile0.00332.0366200.0002
String conversion0.00000.004230.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