Print a table...

Author Message

Monday 05 May 2003 2:12:56 pm

Hi,

I've made a custom class with 3 attributes and I would like to print these attributes in one line in a table. The next line of the table will print the next instance of the class.

Can someone explain how to accomplish this task ?
I know how to make a template and all that but don't know how to fetch the 3 attributes in a template and present them in one table as described.
Example code would be great (I'm a newbie...)

Zinistry Vacana

Monday 05 May 2003 2:46:43 pm

Hi!

Create a line_class_<id of your new class>.tpl in override/templates/node/view/ and include code like this:

<table>
<tr>
<td>
Category:
</td>
<td>
{attribute_view_gui attribute=$node.object.data_map.category}
</td>
<td>
Year:
</td>
<td>
{attribute_view_gui attribute=$node.object.data_map.year}
</td>
<td>
Language:
</td>
<td>
{attribute_view_gui attribute=$node.object.data_map.language}
</td>
</tr>
</table>

If you want a full view of you class, create full_class_<id of your class>.tpl

Tuesday 06 May 2003 5:00:24 am

Thanks this prints out the data :)
The only problem now is that there will be several tables with different length depending on the content instead of one table with all the content.

Any ideas how to get all the data in one table ?
Kind of loop trough the content...

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 18 2025 04:26:13
Script start
Timing: Jan 18 2025 04:26:13
Module start 'layout'
Timing: Jan 18 2025 04:26:13
Module start 'content'
Timing: Jan 18 2025 04:26:14
Module end 'content'
Timing: Jan 18 2025 04:26:14
Script end

Main resources:

Total runtime0.8125 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 587.7891152.6094
Module start 'layout' 0.00620.0039 740.398439.4141
Module start 'content' 0.01010.8010 779.8125505.5703
Module end 'content' 0.81110.0013 1,285.382812.5000
Script end 0.8124  1,297.8828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3971160.0002
Check MTime0.00130.1548160.0001
Mysql Total
Database connection0.00070.088010.0007
Mysqli_queries0.762893.8863570.0134
Looping result0.00060.0727550.0000
Template Total0.765294.220.3826
Template load0.00220.275020.0011
Template processing0.762993.904220.3815
Template load and register function0.00010.011910.0001
states
state_id_array0.00240.296510.0024
state_identifier_array0.00370.460620.0019
Override
Cache load0.00190.2324410.0000
Sytem overhead
Fetch class attribute can translate value0.00050.065220.0003
Fetch class attribute name0.00190.237540.0005
XML
Image XML parsing0.00060.077320.0003
class_abstraction
Instantiating content class attribute0.00000.001450.0000
General
dbfile0.00080.0955160.0000
String conversion0.00000.001340.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs